]> git.eshelyaron.com Git - emacs.git/commitdiff
(timezone-parse-date): Handle new style 22-AUG-1993.
authorRichard M. Stallman <rms@gnu.org>
Sat, 9 Oct 1993 03:46:09 +0000 (03:46 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 9 Oct 1993 03:46:09 +0000 (03:46 +0000)
lisp/timezone.el

index a461f734bfab6db029b7bb753ec96d1573873b3f..c5c68264987005fe8132de362faea67c99260e33 100644 (file)
@@ -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