changeset 27493:005bb11b61bb

(timezone-fix-time): Window against 69 for two-digit years. Deal with three-digit years.
author Dave Love <fx@gnu.org>
date Fri, 28 Jan 2000 23:44:23 +0000
parents 1cc1c05b9ab7
children 6a6704c5e3b4
files lisp/timezone.el
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/timezone.el	Fri Jan 28 23:27:51 2000 +0000
+++ b/lisp/timezone.el	Fri Jan 28 23:44:23 2000 +0000
@@ -197,8 +197,8 @@
     (when year
       (setq year (match-string year date))
       ;; Guess ambiguous years.  Assume years < 69 don't predate the
-      ;; Unix Epoch, so are 2000+.  Three-digit years -- do they ever
-      ;; occur? -- are (arbitrarily) assumed to be 21st century.
+      ;; Unix Epoch, so are 2000+.  Three-digit years are assumed to
+      ;; be relative to 1900.
       (if (< (length year) 4)
 	  (let ((y (string-to-int year)))
 	    (if (< y 69)
@@ -310,10 +310,12 @@
 If TIMEZONE is nil, use the local time zone."
   (let* ((date   (timezone-parse-date date))
 	 (year   (string-to-int (aref date 0)))
-	 (year	 (cond ((< year 50)
+	 (year	 (cond ((< year 69)
 			(+ year 2000))
 		       ((< year 100)
 			(+ year 1900))
+		       ((< year 1000)	; possible 3-digit years.
+			(+ year 1900))
 		       (t year)))
 	 (month  (string-to-int (aref date 1)))
 	 (day    (string-to-int (aref date 2)))