aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/timezone.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/timezone.el b/lisp/timezone.el
index a461f734bfa..c5c68264987 100644
--- a/lisp/timezone.el
+++ b/lisp/timezone.el
@@ -118,13 +118,14 @@ Optional argument TIMEZONE specifies a time zone."
118 (format "%02d:%02d:%02d" hour minute second)) 118 (format "%02d:%02d:%02d" hour minute second))
119 119
120(defun timezone-parse-date (date) 120(defun timezone-parse-date (date)
121 "Parse DATE and return a vector [year month day time timezone]. 121 "Parse DATE and return a vector [YEAR MONTH DAY TIME TIMEZONE].
12219 is prepended to year if necessary. Timezone may be NIL if nothing. 12219 is prepended to year if necessary. Timezone may be nil if nothing.
123Understand the following styles: 123Understands the following styles:
124 (1) 14 Apr 89 03:20[:12] [GMT] 124 (1) 14 Apr 89 03:20[:12] [GMT]
125 (2) Fri, 17 Mar 89 4:01[:33] [GMT] 125 (2) Fri, 17 Mar 89 4:01[:33] [GMT]
126 (3) Mon Jan 16 16:12[:37] [GMT] 1989 126 (3) Mon Jan 16 16:12[:37] [GMT] 1989
127 (4) 6 May 1992 1641-JST (Wednesday)" 127 (4) 6 May 1992 1641-JST (Wednesday)
128 (5) 22-AUG-1993 10:59:12.82"
128 (let ((date (or date "")) 129 (let ((date (or date ""))
129 (year nil) 130 (year nil)
130 (month nil) 131 (month nil)
@@ -145,12 +146,16 @@ Understand the following styles:
145 (setq year 4 month 1 day 2 time 3 zone nil)) 146 (setq year 4 month 1 day 2 time 3 zone nil))
146 ((string-match 147 ((string-match
147 "\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]+\\([-+a-zA-Z0-9]+\\)[ \t]+\\([0-9]+\\)" date) 148 "\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]+\\([-+a-zA-Z0-9]+\\)[ \t]+\\([0-9]+\\)" date)
148 ;; Styles: (3) with timezoen 149 ;; Styles: (3) with timezone
149 (setq year 5 month 1 day 2 time 3 zone 4)) 150 (setq year 5 month 1 day 2 time 3 zone 4))
150 ((string-match 151 ((string-match
151 "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]*\\([-+a-zA-Z0-9]+\\)" date) 152 "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]*\\([-+a-zA-Z0-9]+\\)" date)
152 ;; Styles: (4) with timezone 153 ;; Styles: (4) with timezone
153 (setq year 3 month 2 day 1 time 4 zone 5)) 154 (setq year 3 month 2 day 1 time 4 zone 5))
155 ((string-match
156 "\\([0-9]+\\)-\\([A-Za-z]+\\)-\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9]+:[0-9]+\\)\\.[0-9]+" date)
157 ;; Styles: (5) without timezone.
158 (setq year 3 month 2 day 1 time 4 zone nil))
154 ) 159 )
155 (if year 160 (if year
156 (progn 161 (progn