changeset 4835:4324c797a9e3

(timezone-parse-date): Handle new style 22-AUG-1993.
author Richard M. Stallman <rms@gnu.org>
date Sat, 09 Oct 1993 03:46:09 +0000
parents f2dc5b8eafa8
children 38a0f0209707
files lisp/timezone.el
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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