]> gitweb.factorcode.org Git - factor.git/commitdiff
calendar: rename >local back to >local-time.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 11 Dec 2020 21:43:46 +0000 (13:43 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 11 Dec 2020 21:43:46 +0000 (13:43 -0800)
Sorry for the churn!

basis/calendar/calendar-docs.factor
basis/calendar/calendar.factor
basis/io/files/info/windows/windows.factor

index 22b565cacd322a9b3395690ddda784ff92d1f459..5057209b4edf776c6f9167ffb8bcf3c2080be403 100644 (file)
@@ -271,12 +271,12 @@ HELP: convert-timezone
     }
 } ;
 
-HELP: >local
+HELP: >local-time
 { $values { "timestamp" timestamp } }
 { $description "Converts the " { $snippet "timestamp" } " to the timezone of your computer." }
 { $examples
     { $example "USING: accessors calendar kernel prettyprint ;"
-               "now now-gmt >local [ gmt-offset>> ] same? ."
+               "now now-gmt >local-time [ gmt-offset>> ] same? ."
                "t"
     }
 } ;
@@ -291,17 +291,17 @@ HELP: >gmt
     }
 } ;
 
-HELP: local
+HELP: local-time
 { $values { "timestamp" timestamp } }
 { $description "Set the time zone to the computer's local timezone." }
-{ $notes "The time is not converted, if you want that then call " { $link >local } "." } ;
+{ $notes "The time is not converted, if you want that then call " { $link >local-time } "." } ;
 
 HELP: gmt
 { $values { "timestamp" timestamp } }
 { $description "Set the time zone to GMT." }
 { $notes "The time is not converted, if you want that then call " { $link >gmt } "." } ;
 
-{ local >local gmt >gmt convert-timezone } related-words
+{ local-time >local-time gmt >gmt utc >utc convert-timezone } related-words
 
 HELP: duration*
 { $values { "obj1" object } { "obj2" object } { "obj3" object } }
@@ -511,8 +511,9 @@ ARTICLE: "calendar" "Calendar"
 }
 "Time zones:"
 { $subsections
-    >local
+    >local-time
     >gmt
+    >utc
     convert-timezone
 }
 "Timestamps relative to each other:"
index c34871a7a91723a7ff5e826e90f01d5aded83b69..8997f0e70a5177f86293fc612f6c2e1b47daa0a7 100644 (file)
@@ -305,18 +305,21 @@ DEFER: time-
 : gmt ( timestamp -- timestamp )
     instant >>gmt-offset ; inline
 
-: local ( timestamp -- timestamp )
+: local-time ( timestamp -- timestamp )
     gmt-offset-duration >>gmt-offset ; inline
 
 : convert-timezone ( timestamp duration -- timestamp )
     [ over gmt-offset>> time- (time+) ] [ >>gmt-offset ] bi ;
 
-: >local ( timestamp -- timestamp )
+: >local-time ( timestamp -- timestamp )
     gmt-offset-duration convert-timezone ;
 
 : >gmt ( timestamp -- timestamp )
     instant convert-timezone ;
 
+ALIAS: utc gmt
+ALIAS: >utc >gmt
+
 M: timestamp <=> [ clone >gmt tuple-slots ] compare ;
 
 <PRIVATE
@@ -390,9 +393,9 @@ DEFER: end-of-year
 <PRIVATE
 
 : (time-) ( timestamp timestamp -- n )
-    [ clone >gmt ] bi@
-    [ [ >date< julian-day-number ] bi@ - 86400 * ] 2keep
-    [ >time< [ [ 3600 * ] [ 60 * ] bi* ] dip + + ] bi@ - + ;
+    [ [ >date< julian-day-number ] bi@ - 86400 * ]
+    [ [ >time< [ 3600 * ] [ 60 * + ] [ + ] tri* ] bi@ - + ]
+    [ [ gmt-offset>> duration>seconds ] bi@ swap - + ] 2tri ;
 
 PRIVATE>
 
index 15829af3ac96441977bceeb02756f56219adb623..731f815b402b474d26948c27cb2a65b8354936f5 100644 (file)
@@ -227,7 +227,7 @@ M: windows file-systems
         { FILETIME FILETIME FILETIME }
         [ GetFileTime win32-error=0/f ]
         with-out-parameters
-        [ FILETIME>timestamp >local ] tri@
+        [ FILETIME>timestamp >local-time ] tri@
     ] with-destructors ;
 
 : set-file-times ( path timestamp/f timestamp/f timestamp/f -- )