]> gitweb.factorcode.org Git - factor.git/commitdiff
time.unix: add timestamp>timezone word
authorSlava Pestov <slava@factorcode.org>
Wed, 23 Jun 2010 02:34:38 +0000 (22:34 -0400)
committerSlava Pestov <slava@factorcode.org>
Wed, 23 Jun 2010 02:35:24 +0000 (22:35 -0400)
extra/time/unix/unix.factor

index ba1bc6e3fb5577fccfc90b1c7b5e316fca76a6dd..d4bd45aeae5008993759184e6b7c854fb4bcc3fa 100644 (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