time.unix: add timestamp>timezone word

db4
Slava Pestov 2010-06-22 22:34:38 -04:00
parent 83327635f3
commit 2173c0cafd
1 changed files with 5 additions and 1 deletions

View File

@ -1,8 +1,12 @@
! Copyright (C) 2010 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: calendar kernel math system time unix unix.time ;
USING: accessors calendar classes.struct kernel math system time
unix unix.time ;
IN: time.unix
: timestamp>timezone ( timestamp -- timezone )
gmt-offset>> duration>minutes 1 \ timezone <struct-boa> ; inline
M: unix set-time
[ unix-1970 time- duration>microseconds >integer make-timeval ]
[ timestamp>timezone ] bi