# HG changeset patch # User Richard M. Stallman # Date 750138369 0 # Node ID 4324c797a9e3fa1aaec3e2ac5b239a46dce5c07f # Parent f2dc5b8eafa82fad8385c58fa8cd28c618eafc0b (timezone-parse-date): Handle new style 22-AUG-1993. diff -r f2dc5b8eafa8 -r 4324c797a9e3 lisp/timezone.el --- a/lisp/timezone.el Fri Oct 08 15:28:23 1993 +0000 +++ b/lisp/timezone.el Sat Oct 09 03:46:09 1993 +0000 @@ -118,13 +118,14 @@ (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 @@ (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