diff options
Diffstat (limited to 'lisp/timezone.el')
-rw-r--r-- | lisp/timezone.el | 15 |
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." (format "%02d:%02d:%02d" hour minute second)) (defun timezone-parse-date (date) - "Parse DATE and return a vector [year month day time timezone]. -19 is prepended to year if necessary. Timezone may be NIL if nothing. -Understand the following styles: + "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)" + (4) 6 May 1992 1641-JST (Wednesday) + (5) 22-AUG-1993 10:59:12.82" (let ((date (or date "")) (year nil) (month nil) @@ -145,12 +146,16 @@ Understand the following styles: (setq year 4 month 1 day 2 time 3 zone nil)) ((string-match "\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]+\\([-+a-zA-Z0-9]+\\)[ \t]+\\([0-9]+\\)" date) - ;; Styles: (3) with timezoen + ;; Styles: (3) with timezone (setq year 5 month 1 day 2 time 3 zone 4)) ((string-match "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]*\\([-+a-zA-Z0-9]+\\)" date) ;; Styles: (4) with timezone (setq year 3 month 2 day 1 time 4 zone 5)) + ((string-match + "\\([0-9]+\\)-\\([A-Za-z]+\\)-\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9]+:[0-9]+\\)\\.[0-9]+" date) + ;; Styles: (5) without timezone. + (setq year 3 month 2 day 1 time 4 zone nil)) ) (if year (progn |