     1970 1 1 0 0 0 0 <timestamp> ;
 
 : unix-time>timestamp ( n -- timestamp )
-    >r unix-1970 r> seconds +dt ; 
+    >r unix-1970 r> seconds +dt ;
 
 : timestamp>unix-time ( timestamp -- n )
     unix-1970 timestamp- >bignum ;
 
-: timestamp>timeval ( timestamp -- timeval ) 
-    timestamp>unix-time 1000 * make-timeval ; 
-
-: timeval>timestamp ( timeval -- timestamp ) 
+: timestamp>timeval ( timestamp -- timeval )
+    timestamp>unix-time 1000 * make-timeval ;
+
+: timeval>timestamp ( timeval -- timestamp )
     [ timeval-sec ] keep
-    timeval-usec 1000000 / + unix-time>timestamp ; 
-
-: timestamp>timespec ( timestamp -- timespec ) 
-    timestamp>unix-time "timespec" <c-object>
-    [ set-timespec-sec ] keep ; 
-
-: timespec>timestamp ( timespec -- timestamp ) 
-    [ timespec-sec ] keep
-    timespec-nsec 1000000000 / + 
-    unix-time>timestamp ; 
-
+    timeval-usec 1000000 / + unix-time>timestamp ;
 
 
 : gmt ( -- timestamp )
     #! GMT time, right now
-    unix-1970 millis 1000 /f seconds +dt ; 
+    unix-1970 millis 1000 /f seconds +dt ;
 
 : now ( -- timestamp ) gmt >local-time ;
 : before ( dt -- -dt ) tuple-slots [ neg ] map array>dt ;

USING: arrays hashtables io io.streams.string kernel math
math.vectors math.functions math.parser namespaces sequences
strings tuples system debugger combinators vocabs.loader
calendar.backend structs alien.c-types unix ;
IN: calendar

TUPLE: timestamp year month day hour minute second gmt-offset ;

    over timestamp-minute + 60 /rem pick
    set-timestamp-minute +hour ;
M: real +minute ( timestamp n -- timestamp )
    float>whole-part rot swap 60 * +second swap +minute ;

M: number +second ( timestamp n -- timestamp )
    over timestamp-second + 60 /rem >r >bignum r>
