diff options
author | Dave Love <fx@gnu.org> | 2000-01-28 23:44:23 +0000 |
---|---|---|
committer | Dave Love <fx@gnu.org> | 2000-01-28 23:44:23 +0000 |
commit | 74932e46d2d3be057de81a8975a4259338a01c5d (patch) | |
tree | f7cd80c2626e5d6e227f5bd4f732e936d2b3ad3b /lisp/timezone.el | |
parent | bc3fa12fd480c5498f52878886ee2ba77c063f70 (diff) | |
download | emacs-74932e46d2d3be057de81a8975a4259338a01c5d.tar.gz |
(timezone-fix-time): Window against 69 for two-digit years. Deal with
three-digit years.
Diffstat (limited to 'lisp/timezone.el')
-rw-r--r-- | lisp/timezone.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/timezone.el b/lisp/timezone.el index 8f21f8f3765..d6473158f36 100644 --- a/lisp/timezone.el +++ b/lisp/timezone.el @@ -197,8 +197,8 @@ Understands the following styles: (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 LOCAL is nil, it is assumed to be GMT. 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))) |