From 9751a38fa73f7b1f48293f8c77c6a6eaa3b5a8a0 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 6 Oct 2008 21:04:30 -0500 Subject: [PATCH] since-1970 docs --- basis/calendar/calendar-docs.factor | 6 ++++++ basis/calendar/calendar.factor | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/basis/calendar/calendar-docs.factor b/basis/calendar/calendar-docs.factor index f1cdafb476..64c74a494a 100644 --- a/basis/calendar/calendar-docs.factor +++ b/basis/calendar/calendar-docs.factor @@ -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 } diff --git a/basis/calendar/calendar.factor b/basis/calendar/calendar.factor index d5824768f4..c002760748 100644 --- a/basis/calendar/calendar.factor +++ b/basis/calendar/calendar.factor @@ -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 ;