22 lines
852 B
Factor
22 lines
852 B
Factor
! Copyright (C) 2008 Doug Coleman.
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
USING: kernel alien.syntax alien.c-types math unix.types ;
|
|
IN: unix.time
|
|
|
|
C-STRUCT: tm
|
|
{ "int" "sec" } ! Seconds: 0-59 (K&R says 0-61?)
|
|
{ "int" "min" } ! Minutes: 0-59
|
|
{ "int" "hour" } ! Hours since midnight: 0-23
|
|
{ "int" "mday" } ! Day of the month: 1-31
|
|
{ "int" "mon" } ! Months *since* january: 0-11
|
|
{ "int" "year" } ! Years since 1900
|
|
{ "int" "wday" } ! Days since Sunday (0-6)
|
|
{ "int" "yday" } ! Days since Jan. 1: 0-365
|
|
{ "int" "isdst" } ! +1 Daylight Savings Time, 0 No DST,
|
|
{ "long" "gmtoff" } ! Seconds: 0-59 (K&R says 0-61?)
|
|
{ "char*" "zone" } ;
|
|
|
|
FUNCTION: time_t time ( time_t* t ) ;
|
|
FUNCTION: tm* localtime ( time_t* clock ) ;
|
|
FUNCTION: int gettimeofday ( timespec* TP, void* TZP ) ;
|