]> gitweb.factorcode.org Git - factor.git/blob - extra/time/unix/unix.factor
classes.struct: moving to new/boa instead of <struct>/<struct-boa>
[factor.git] / extra / time / unix / unix.factor
1 ! Copyright (C) 2010 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors calendar classes.struct kernel libc math
4 system time unix unix.time ;
5 IN: time.unix
6
7 : timestamp>timezone ( timestamp -- timezone )
8     gmt-offset>> duration>minutes 1 \ timezone boa ; inline
9
10 M: unix set-system-time
11     [ unix-1970 time- duration>microseconds >integer make-timeval ]
12     [ timestamp>timezone ] bi
13     settimeofday io-error ;