]> gitweb.factorcode.org Git - factor.git/commitdiff
since-1970 docs
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 7 Oct 2008 02:04:30 +0000 (21:04 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 7 Oct 2008 02:04:30 +0000 (21:04 -0500)
basis/calendar/calendar-docs.factor
basis/calendar/calendar.factor

index f1cdafb476a9c27407d539c38d9ae3067de3bc6e..64c74a494a4dd35c359557371880844ea7046481 100644 (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 }
index d5824768f45bc407f12ca4ab77e50d24b0aa11ea..c0027607488f64a9238d27ecdafefdf940a8c1de 100644 (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 ;