diff lisp/utils/timezone.el @ 86:364816949b59 r20-0b93

Import from CVS: tag r20-0b93
author cvs
date Mon, 13 Aug 2007 09:09:02 +0200
parents 6a378aca36af
children 43dd3413c7c7
line wrap: on
line diff
--- a/lisp/utils/timezone.el	Mon Aug 13 09:08:31 2007 +0200
+++ b/lisp/utils/timezone.el	Mon Aug 13 09:09:02 2007 +0200
@@ -129,6 +129,9 @@
   "Make time string from HOUR, MINUTE, and SECOND."
   (format "%02d:%02d:%02d" hour minute second))
 
+;;;###autoload
+(define-error 'invalid-date "Invalid date string")
+
 (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.
@@ -140,6 +143,8 @@
  (5) 22-AUG-1993 10:59:12.82
  (6) Thu, 11 Apr 16:17:12 91 [MET]
  (7) Mon, 6  Jul 16:47:20 T 1992 [MET]"
+  (condition-case nil
+      (progn
   ;; Get rid of any text properties.
   (and (stringp date)
        (or (text-properties-at 0 date)
@@ -219,7 +224,10 @@
     (if year
 	(vector year month day time zone)
       (vector "0" "0" "0" "0" nil))
-    ))
+    )
+  )
+    (t (signal 'invalid-date (list date))))
+)
 
 (defun timezone-parse-time (time)
   "Parse TIME (HH:MM:SS) and return a vector [hour minute second].