time* ( obj1 obj2 -- obj3 )
Calendar > Timestamp arithmetic
Prev:time- ( time1 time2 -- time3 )


Vocabulary
calendar

Inputs and outputs
obj1an object
obj2an object
obj3an 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.

See also
time+, time-

Definition
USING: accessors combinators kernel math ;

IN: calendar

: time* ( obj1 obj2 -- obj3 )
dup real? [ swap ] when dup real?
[ * ] [
{
[ year>> * ]
[ month>> * ]
[ day>> * ]
[ hour>> * ]
[ minute>> * ]
[ second>> * ]
} 2cleave <duration>
] if ;