;ELC ;;; compiled by jwz@thalidomide on Sat Nov 13 17:56:27 1993 ;;; from file /th/jwz/emacs19/lisp/gnus/timezone.el ;;; emacs version 19.9 Lucid. ;;; bytecomp version 2.20; 20-oct-93. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (provide 'timezone) (defvar timezone-world-timezones '(("PST" . -800) ("PDT" . -700) ("MST" . -700) ("MDT" . -600) ("CST" . -600) ("CDT" . -500) ("EST" . -500) ("EDT" . -400) ("AST" . -400) ("NST" . -330) ("GMT" . 0) ("BST" . 100) ("MET" . 100) ("EET" . 200) ("JST" . 900) ("GMT+1" . 100) ("GMT+2" . 200) ("GMT+3" . 300) ("GMT+4" . 400) ("GMT+5" . 500) ("GMT+6" . 600) ("GMT+7" . 700) ("GMT+8" . 800) ("GMT+9" . 900) ("GMT+10" . 1000) ("GMT+11" . 1100) ("GMT+12" . 1200) ("GMT+13" . 1300) ("GMT-1" . -100) ("GMT-2" . -200) ("GMT-3" . -300) ("GMT-4" . -400) ("GMT-5" . -500) ("GMT-6" . -600) ("GMT-7" . -700) ("GMT-8" . -800) ("GMT-9" . -900) ("GMT-10" . -1000) ("GMT-11" . -1100) ("GMT-12" . -1200)) "\ *Time differentials of timezone from GMT in +-HHMM form. This list is obsolescent, and is present only for backwards compatibility, because time zone names are ambiguous in practice. Use `current-time-zone' instead.") (defvar timezone-months-assoc '(("JAN" . 1) ("FEB" . 2) ("MAR" . 3) ("APR" . 4) ("MAY" . 5) ("JUN" . 6) ("JUL" . 7) ("AUG" . 8) ("SEP" . 9) ("OCT" . 10) ("NOV" . 11) ("DEC" . 12)) "\ Alist of first three letters of a month and its numerical representation.") (fset 'timezone-make-date-arpa-standard #[(date &optional local timezone) "À \n #Å ÆH ÇH ÈHÉ ÊH ËH ÌH# ÍH%)‡" [timezone-fix-time date local timezone new timezone-make-arpa-date 0 1 2 timezone-make-time-string 3 4 5 6] 9 "\ Convert DATE to an arpanet standard date. Optional 1st argument LOCAL specifies the default local timezone of the DATE; if nil, GMT is assumed. Optional 2nd argument TIMEZONE specifies a time zone to be represented in; if nil, the local time zone is assumed."]) (fset 'timezone-make-date-sortable #[(date &optional local timezone) "À \n #Å ÆH ÇH ÈHÉ ÊH ËH ÌH#$)‡" [timezone-fix-time date local timezone new timezone-make-sortable-date 0 1 2 timezone-make-time-string 3 4 5] 9 "\ Convert DATE to a sortable date string. Optional 1st argument LOCAL specifies the default local timezone of the DATE; if nil, GMT is assumed. Optional 2nd argument TIMEZONE specifies a timezone to be represented in; if nil, the local time zone is assumed."]) (fset 'timezone-make-arpa-date #[(year month day time &optional timezone) "<«¤Á!‰ÃW«„\n[ª\nÅÆ\nÃW«ƒÇªÈ É¥ ɦ$*ª\nÅË ÍÎ\"@!\n&)‡" [timezone timezone-zone-to-minute m 0 absm format "%c%02d%02d" 45 43 60 zone "%02d %s %04d %s %s" day capitalize rassq month timezone-months-assoc year time] 8 "\ Make arpanet standard date string from YEAR, MONTH, DAY, and TIME. Optional argument TIMEZONE specifies a time zone."]) (fset 'timezone-make-sortable-date #[(year month day time) "ÀÁ\n %‡" [format "%4d%02d%02d%s" year month day time] 6 "\ Make sortable date string from YEAR, MONTH, DAY, and TIME."]) (fset 'timezone-make-time-string #[(hour minute second) "ÀÁ\n $‡" [format "%02d:%02d:%02d" hour minute second] 5 "\ Make time string from HOUR, MINUTE, and SECOND."]) (fset 'timezone-parse-date #[(date) "®Á‰‰‰‰ÈÉ\"«ŽÊËÌͪâÈÎ\"«ŽÊËÌÍϪÎÈÐ\"«ŽÍÌËʪºÈÑ\"«ŽÏÌËÊͪ¦ÈÒ\"«ŽÊËÌÍϪ’ÈÓ\"«ŒÊËÌÍ«»”•O‰GÍW«‰ÔÕÂOPÖ×””Ê\\O–\"A! ” •O ” •O «‡ ” •O«‹Ù %ª‡ÙÚ‰‰‰Â%.‡" [date "" nil zone time day month year string-match "\\([0-9]+\\)[ ]+\\([^ ,]+\\)[ ]+\\([0-9]+\\)[ ]+\\([0-9]+:[0-9:]+\\)[ ]*\\'" 3 2 1 4 "\\([0-9]+\\)[ ]+\\([^ ,]+\\)[ ]+\\([0-9]+\\)[ ]+\\([0-9]+:[0-9:]+\\)[ ]*\\([-+a-zA-Z0-9]+\\)" 5 "\\([^ ,]+\\)[ ]+\\([0-9]+\\)[ ]+\\([0-9]+:[0-9:]+\\)[ ]+\\([0-9]+\\)" "\\([^ ,]+\\)[ ]+\\([0-9]+\\)[ ]+\\([0-9]+:[0-9:]+\\)[ ]+\\([-+a-zA-Z0-9]+\\)[ ]+\\([0-9]+\\)" "\\([0-9]+\\)[ ]+\\([^ ,]+\\)[ ]+\\([0-9]+\\)[ ]+\\([0-9]+\\)[ ]*\\([-+a-zA-Z0-9]+\\)" "\\([0-9]+\\)-\\([A-Za-z]+\\)-\\([0-9]+\\)[ ]+\\([0-9]+:[0-9]+:[0-9]+\\)\\.[0-9]+" "19" -2 int-to-string assoc timezone-months-assoc vector "0"] 7 "\ Parse DATE and return a vector [YEAR MONTH DAY TIME TIMEZONE]. 19 is prepended to year if necessary. Timezone may be nil if nothing. Understands the following styles: (1) 14 Apr 89 03:20[:12] [GMT] (2) Fri, 17 Mar 89 4:01[:33] [GMT] (3) Mon Jan 16 16:12[:37] [GMT] 1989 (4) 6 May 1992 1641-JST (Wednesday) (5) 22-AUG-1993 10:59:12.82"]) (fset 'timezone-parse-time #[(time) "®Á‰‰ÆÇ\"«ˆÈÉʪ¨ÆË\"«ˆÈɪšÆÌ\"«ˆÈÉʪŒÆÍ\"«†ÈÉÂÎ «ˆ ” •OªÏ «ˆ ” •OªÏ «ˆ ” •OªÏ#,‡" [time "" nil second minute hour string-match "\\`\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\)\\'" 1 2 3 "\\`\\([0-9]+\\):\\([0-9]+\\)\\'" "\\`\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\'" "\\`\\([0-9][0-9]\\)\\([0-9][0-9]\\)\\'" vector "0"] 6 "\ Parse TIME (HH:MM:SS) and return a vector [hour minute second]. Recognize HH:MM:SS, HH:MM, HHMMSS, HHMM."]) (fset 'timezone-zone-to-minute #[(timezone) ":«…@Á¥‡«±Â– \"A®‰;«„Ä!Å!‰Ç¥Á_Ǧ\\ÉW«…[ª‚*‡É‡" [timezone 60 assoc timezone-world-timezones string-to-int abs abszone 100 minutes 0] 4 "\ Translate TIMEZONE to an integer minute offset from GMT. TIMEZONE can be a cons cell containing the output of current-time-zone, or an integer of the form +-HHMM, or a time zone name."]) (fset 'timezone-time-from-absolute #[(date seconds) "À\n ZÄÅ! _\\ÄÈ! Ê ¥!‰  _ Ê Z! Î  \\Z!ÏW­…  B.‡" [719162 current-time-origin date days float 86400 seconds-per-day seconds 65536 current-time-arithmetic-base floor hi hibase lo abs 2] 5 "\ Compute the UTC time equivalent to DATE at time SECONDS after midnight. Return a list suitable as an argument to current-time-zone, or nil if the date cannot be thus represented. DATE is the number of days elapsed since the (imaginary) Gregorian date Sunday, December 31, 1 BC."]) (fset 'timezone-time-zone-from-absolute #[(date seconds) "ÀÁ!­•Â \"‰­ŒÁ !‰@­‚))‡" [fboundp current-time-zone timezone-time-from-absolute date seconds utc-time zone] 4 "\ Compute the local time zone for DATE at time SECONDS after midnight. Return a list in the same format as current-time-zone's result, or nil if the local time zone could not be computed. DATE is the number of days elapsed since the (imaginary) Gregorian date Sunday, December 31, 1 BC."]) (fset 'timezone-fix-time #[(date local timezone) "À ! ÃH!‰ÅW«… Æ\\ª  ÇH! ÉH!\nË ÌH!  ÃH! ÇH! ÉH! ÑH®‚®•ÔÕ\n #Ö_\\Ö_\\\"×!×!Z\\ÙÖ\"\\Ö_ZÛX««ÛZ\nT\nÜ \"\nW«ÅTÇ\nÝW«·Ç Tª¯ÃV«©Û\\\nS\nÇ\nV«˜SÇV«†Ý SÜ \"\nÞ \n&.‡" [timezone-parse-date date string-to-int 0 year 100 1900 1 month 2 day timezone-parse-time 3 time hour minute second 4 local timezone timezone-time-zone-from-absolute timezone-absolute-from-gregorian 60 timezone-zone-to-minute diff floor hour-fix 24 timezone-last-day-of-month 12 vector] 9 "\ Convert DATE (default timezone LOCAL) to YYYY-MM-DD-HH-MM-SS-ZONE vector. If LOCAL is nil, it is assumed to be GMT. If TIMEZONE is nil, use the local time zone."]) (fset 'timezone-last-day-of-month #[(month year) "ÁU«‡Â !«‚ćÅSH‡" [month 2 timezone-leap-year-p year 29 [31 28 31 30 31 30 31 31 30 31 30 31]] 2 "\ The last day in MONTH during YEAR."]) (fset 'timezone-leap-year-p #[(year) "Á¦ÂU«ˆæÂU?®…ĦÂU‡" [year 4 0 100 400] 2 "\ Returns t if YEAR is a Gregorian leap year."]) (fset 'timezone-day-number #[(month day year) " SÂ_\\ ÄV«“ Å_Æ\\Ç¥ZÈ !«ƒ T )‡" [day month 31 day-of-year 2 4 23 10 timezone-leap-year-p year] 3 "\ Return the day number within the year of the date month/day/year."]) (fset 'timezone-absolute-from-gregorian #[(month day year) "À \n # SÄ_ SÅ¥ SÆ¥[ SÇ¥\\\\\\\\‡" [timezone-day-number month day year 365 4 100 400] 6 "\ The number of days between the Gregorian date 12/31/1 BC and month/day/year. The Gregorian date Sunday, December 31, 1 BC is imaginary."])