diff options
| author | Dave Love | 2000-01-28 23:44:23 +0000 |
|---|---|---|
| committer | Dave Love | 2000-01-28 23:44:23 +0000 |
| commit | d1912872e723fa3c421886e894e6aa6ffbe18440 (patch) | |
| tree | 096231415f0d29d33665da49b37f7ec56f749124 /lisp | |
| parent | 4607e12b53afe473f6a638f5e29f1173cb8aa902 (diff) | |
| download | emacs-d1912872e723fa3c421886e894e6aa6ffbe18440.tar.gz emacs-d1912872e723fa3c421886e894e6aa6ffbe18440.zip | |
(timezone-fix-time): Window against 69 for two-digit years. Deal with
three-digit years.
Diffstat (limited to 'lisp')
| -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: | |||
| 197 | (when year | 197 | (when year |
| 198 | (setq year (match-string year date)) | 198 | (setq year (match-string year date)) |
| 199 | ;; Guess ambiguous years. Assume years < 69 don't predate the | 199 | ;; Guess ambiguous years. Assume years < 69 don't predate the |
| 200 | ;; Unix Epoch, so are 2000+. Three-digit years -- do they ever | 200 | ;; Unix Epoch, so are 2000+. Three-digit years are assumed to |
| 201 | ;; occur? -- are (arbitrarily) assumed to be 21st century. | 201 | ;; be relative to 1900. |
| 202 | (if (< (length year) 4) | 202 | (if (< (length year) 4) |
| 203 | (let ((y (string-to-int year))) | 203 | (let ((y (string-to-int year))) |
| 204 | (if (< y 69) | 204 | (if (< y 69) |
| @@ -310,10 +310,12 @@ If LOCAL is nil, it is assumed to be GMT. | |||
| 310 | If TIMEZONE is nil, use the local time zone." | 310 | If TIMEZONE is nil, use the local time zone." |
| 311 | (let* ((date (timezone-parse-date date)) | 311 | (let* ((date (timezone-parse-date date)) |
| 312 | (year (string-to-int (aref date 0))) | 312 | (year (string-to-int (aref date 0))) |
| 313 | (year (cond ((< year 50) | 313 | (year (cond ((< year 69) |
| 314 | (+ year 2000)) | 314 | (+ year 2000)) |
| 315 | ((< year 100) | 315 | ((< year 100) |
| 316 | (+ year 1900)) | 316 | (+ year 1900)) |
| 317 | ((< year 1000) ; possible 3-digit years. | ||
| 318 | (+ year 1900)) | ||
| 317 | (t year))) | 319 | (t year))) |
| 318 | (month (string-to-int (aref date 1))) | 320 | (month (string-to-int (aref date 1))) |
| 319 | (day (string-to-int (aref date 2))) | 321 | (day (string-to-int (aref date 2))) |