HomeManualTopicsTypesSymbols

std_types::date_and_time/std::minus

subtracts a time delta or another date-and-time object from a date-and-time object

Parameters

self
the date-and-time object
seconds_or_date_and_time
the number of seconds or another date-and-time
object

Results

date_and_time_or_seconds
the date-and-time object with the seconds
subtracted or the time difference in seconds

Example

current_time! $t println! t println! t-24*60*60

Output

2024-01-14 9:35:31.845 GMT+1 2024-01-13 9:35:31.845 GMT+1

Example

current_time! $t1 $t2 date_and_time(2024 1 1 0 0 0) println! t1-t2

Output

1705221411.28341

Topic

Date and Time

Implements

std::minus subtract two numbers of any kind

See also

std::from_unix_time constructs a date-and-time object from the number of seconds since the UNIX epoch
std_types::date_and_time/std::plus adds an arbitrary time delta to a date-and-time object