comparison lisp/utils/timezone.el @ 155:43dd3413c7c7 r20-3b4

Import from CVS: tag r20-3b4
author cvs
date Mon, 13 Aug 2007 09:39:39 +0200
parents 364816949b59
children
comparison
equal deleted inserted replaced
154:94141801dd7e 155:43dd3413c7c7
73 ("OCT" . 10)("NOV" . 11)("DEC" . 12)) 73 ("OCT" . 10)("NOV" . 11)("DEC" . 12))
74 "Alist of first three letters of a month and its numerical representation.") 74 "Alist of first three letters of a month and its numerical representation.")
75 75
76 (defun timezone-make-date-arpa-standard (date &optional local timezone) 76 (defun timezone-make-date-arpa-standard (date &optional local timezone)
77 "Convert DATE to an arpanet standard date. 77 "Convert DATE to an arpanet standard date.
78 Optional 1st argument LOCAL specifies the default local timezone of the DATE; 78 Optional 2nd argument LOCAL specifies the default local timezone of the DATE;
79 if nil, GMT is assumed. 79 if nil, GMT is assumed.
80 Optional 2nd argument TIMEZONE specifies a time zone to be represented in; 80 Optional 3rd argument TIMEZONE specifies a time zone to be represented in;
81 if nil, the local time zone is assumed." 81 if nil, the local time zone is assumed."
82 (let ((new (timezone-fix-time date local timezone))) 82 (let ((new (timezone-fix-time date local timezone)))
83 (timezone-make-arpa-date (aref new 0) (aref new 1) (aref new 2) 83 (timezone-make-arpa-date (aref new 0) (aref new 1) (aref new 2)
84 (timezone-make-time-string 84 (timezone-make-time-string
85 (aref new 3) (aref new 4) (aref new 5)) 85 (aref new 3) (aref new 4) (aref new 5))
86 (aref new 6)) 86 (aref new 6))
87 )) 87 ))
88 88
89 (defun timezone-make-date-sortable (date &optional local timezone) 89 (defun timezone-make-date-sortable (date &optional local timezone)
90 "Convert DATE to a sortable date string. 90 "Convert DATE to a sortable date string.
91 Optional 1st argument LOCAL specifies the default local timezone of the DATE; 91 Optional 2nd argument LOCAL specifies the default local timezone of the DATE;
92 if nil, GMT is assumed. 92 if nil, GMT is assumed.
93 Optional 2nd argument TIMEZONE specifies a timezone to be represented in; 93 Optional 3rd argument TIMEZONE specifies a timezone to be represented in;
94 if nil, the local time zone is assumed." 94 if nil, the local time zone is assumed."
95 (let ((new (timezone-fix-time date local timezone))) 95 (let ((new (timezone-fix-time date local timezone)))
96 (timezone-make-sortable-date (aref new 0) (aref new 1) (aref new 2) 96 (timezone-make-sortable-date (aref new 0) (aref new 1) (aref new 2)
97 (timezone-make-time-string 97 (timezone-make-time-string
98 (aref new 3) (aref new 4) (aref new 5))) 98 (aref new 3) (aref new 4) (aref new 5)))