Handbook
Glossary
time- ( time1 time2 -- time3 )
Calendar
ยป
Timestamp arithmetic
Prev:
time+ ( time1 time2 -- time3 )
Next:
duration* ( obj1 obj2 -- obj3 )
Vocabulary
calendar
Inputs
time1
a
timestamp
or a
duration
time2
a
timestamp
or a
duration
Outputs
time3
a
timestamp
or a
duration
Word description
Subtracts two durations to produce a duration or subtracts a duration from a timestamp to produce a timestamp. The calculation takes timezones into account.
Examples
USING: calendar math.order prettyprint ; 10 months 2 months time- 8 months <=> .
+eq+
USING: accessors calendar math.order prettyprint ; 2010 1 1 <date> 3 days time- day>> .
29
See also
time+
Definition
IN:
calendar
GENERIC:
time-
( time1 time2 -- time3 )
Methods
USING:
calendar
kernel
;
M:
duration
time-
over
timestamp?
[
before
time+
]
[
duration-
]
if
;
USING:
calendar
calendar.private
;
M:
timestamp
time-
(time-)
seconds
;