since-1970 docs
parent
1f1a62fcdd
commit
9751a38fa7
|
@ -512,6 +512,12 @@ HELP: time-since-midnight
|
||||||
{ $values { "timestamp" timestamp } { "duration" duration } }
|
{ $values { "timestamp" timestamp } { "duration" duration } }
|
||||||
{ $description "Calculates a " { $snippet "duration" } " that represents the elapsed time since midnight of the input " { $snippet "timestamp" } "." } ;
|
{ $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"
|
ARTICLE: "calendar" "Calendar"
|
||||||
"The two data types used throughout the calendar library:"
|
"The two data types used throughout the calendar library:"
|
||||||
{ $subsection timestamp }
|
{ $subsection timestamp }
|
||||||
|
|
|
@ -401,7 +401,7 @@ PRIVATE>
|
||||||
: time-since-midnight ( timestamp -- duration )
|
: time-since-midnight ( timestamp -- duration )
|
||||||
dup midnight time- ;
|
dup midnight time- ;
|
||||||
|
|
||||||
: since-1970 ( time -- timestamp )
|
: since-1970 ( duration -- timestamp )
|
||||||
unix-1970 time+ >local-time ;
|
unix-1970 time+ >local-time ;
|
||||||
|
|
||||||
M: timestamp sleep-until timestamp>millis sleep-until ;
|
M: timestamp sleep-until timestamp>millis sleep-until ;
|
||||||
|
|
Loading…
Reference in New Issue