]> gitweb.factorcode.org Git - factor.git/blob - basis/calendar/unix/unix.factor
Create basis vocab root
[factor.git] / basis / calendar / unix / unix.factor
1 USING: alien alien.c-types arrays calendar.backend
2 kernel structs math unix.time namespaces system ;
3 IN: calendar.unix
4
5 : get-time ( -- alien )
6     f time <uint> localtime ;
7
8 : timezone-name ( -- string )
9     get-time tm-zone ;
10
11 M: unix gmt-offset ( -- hours minutes seconds )
12     get-time tm-gmtoff 3600 /mod 60 /mod ;