Handbook
Glossary
duration* ( obj1 obj2 -- obj3 )
Calendar
ยป
Timestamp arithmetic
Prev:
time- ( time1 time2 -- time3 )
Vocabulary
calendar
Inputs
obj1
an
object
obj2
an
object
Outputs
obj3
an
object
Word description
Multiplies each time slot of a timestamp or duration by a number and make a new duration from the result. Used in the implementation of
before
.
Definition
USING:
accessors
combinators
kernel
math
;
IN:
calendar
:
duration*
( obj1 obj2 -- obj3 )
dup
real?
[
swap
]
when
dup
real?
[
*
]
[
{
[
year>>
*
]
[
month>>
*
]
[
day>>
*
]
[
hour>>
*
]
[
minute>>
*
]
[
second>>
*
]
}
2cleave
<duration>
]
if
;