time.unix: add timestamp>timezone word

Slava Pestov 2010-06-22 22:34:38 -04:00
parent ba7cf1f873
commit 0a657b7221
1 changed files with 5 additions and 1 deletions

View File

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