Paste: teh internets time :)
Author: | vegai |
Mode: | factor |
Date: | Sun, 17 May 2009 19:39:20 |
Plain Text |
USING: accessors kernel math calendar ;
IN: calendar.swatch
CONSTANT: beats/day 1000
: beats/hour ( -- beats )
beats/day 24 / ;
: beats/minute ( -- beats )
beats/hour 60 / ;
: beats/second ( -- beats )
beats/minute 60 / ;
: timestamp>swatch ( timestamp -- beats )
dup hour>> beats/hour * swap
dup minute>> beats/minute * swap
second>> beats/second *
+ + ;
: now-swatch ( -- beats )
gmt timestamp>swatch beats/hour + ;
New Annotation