since-1970 docs

db4
Doug Coleman 2008-10-06 21:04:30 -05:00
parent 1f1a62fcdd
commit 9751a38fa7
2 changed files with 7 additions and 1 deletions

View File

@ -512,6 +512,12 @@ HELP: time-since-midnight
{ $values { "timestamp" timestamp } { "duration" duration } }
{ $description "Calculates a " { $snippet "duration" } " that represents the elapsed time since midnight of the input " { $snippet "timestamp" } "." } ;
HELP: since-1970
{ $values
{ "duration" duration }
{ "timestamp" timestamp } }
{ $description "Adds the duration to the beginning of Unix time and returns the result as a timestamp." } ;
ARTICLE: "calendar" "Calendar"
"The two data types used throughout the calendar library:"
{ $subsection timestamp }

View File

@ -401,7 +401,7 @@ PRIVATE>
: time-since-midnight ( timestamp -- duration )
dup midnight time- ;
: since-1970 ( time -- timestamp )
: since-1970 ( duration -- timestamp )
unix-1970 time+ >local-time ;
M: timestamp sleep-until timestamp>millis sleep-until ;