 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel alien.syntax alien.c-types math unix.types
-classes.struct accessors ;
+USING: accessors alien.c-types alien.syntax calendar
+classes.struct kernel math unix.types ;
 IN: unix.time
 
 STRUCT: timeval

FUNCTION: time_t time ( time_t* t ) ;
FUNCTION: tm* localtime ( time_t* clock ) ;
FUNCTION: int gettimeofday ( timespec* TP, void* TZP ) ;

        swap >>nsec
        swap >>sec ;

STRUCT: timezone
    { tz_minuteswest int }
    { tz_dsttime int } ;

: timestamp>timezone ( timestamp -- timezone )
    gmt-offset>> duration>minutes
    1
    \ timezone <struct-boa> ; inline

STRUCT: tm
    { sec int }
    { min int }
