convert-timezone ( timestamp duration -- timestamp ) - Factor Documentation

convert-timezone ( timestamp duration -- timestamp )
Calendar



Vocabulary
calendar

Inputs
timestamp a timestamp
duration a duration


Outputs
timestamp a timestamp


Word description
Converts the timestamp's gmt-offset to the GMT offset represented by the duration.

Examples
USING: accessors calendar prettyprint ; now-gmt noon instant -5 >>hour convert-timezone gmt-offset>> hour>> .
-5


See also
local-time , >local-time , convert-local-time , gmt , >gmt , convert-gmt , utc , >utc , convert-utc

Definition
USING: accessors calendar.private kernel ;

IN: calendar

: convert-timezone ( timestamp duration -- timestamp )
[ over gmt-offset>> time- (time+) ] [ >>gmt-offset ] bi ;

AltStyle によって変換されたページ (->オリジナル) /