Mercurial > emacs
comparison lisp/calendar/cal-dst.el @ 74870:06cc5e77c85a
(calendar-dst-starts): Default to second Sunday in March.
(calendar-dst-ends): Default to first Sunday in November.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 24 Dec 2006 02:58:41 +0000 |
parents | cfa3c02ad6bf |
children | 07a95dc49e5a |
comparison
equal
deleted
inserted
replaced
74869:b507f3dc4bbc | 74870:06cc5e77c85a |
---|---|
51 :type 'boolean | 51 :type 'boolean |
52 :version "22.1" | 52 :version "22.1" |
53 :group 'calendar) | 53 :group 'calendar) |
54 | 54 |
55 (defvar calendar-current-time-zone-cache nil | 55 (defvar calendar-current-time-zone-cache nil |
56 "Cache for result of calendar-current-time-zone.") | 56 "Cache for result of `calendar-current-time-zone'.") |
57 (put 'calendar-current-time-zone-cache 'risky-local-variable t) | |
57 | 58 |
58 (defvar calendar-system-time-basis | 59 (defvar calendar-system-time-basis |
59 (calendar-absolute-from-gregorian '(1 1 1970)) | 60 (calendar-absolute-from-gregorian '(1 1 1970)) |
60 "Absolute date of starting date of system clock.") | 61 "Absolute date of starting date of system clock.") |
61 | 62 |
344 (or (let ((expr (if calendar-dst-check-each-year-flag | 345 (or (let ((expr (if calendar-dst-check-each-year-flag |
345 (cadr (calendar-dst-find-startend year)) | 346 (cadr (calendar-dst-find-startend year)) |
346 (nth 4 calendar-current-time-zone-cache)))) | 347 (nth 4 calendar-current-time-zone-cache)))) |
347 (if expr (eval expr))) | 348 (if expr (eval expr))) |
348 (and (not (zerop calendar-daylight-time-offset)) | 349 (and (not (zerop calendar-daylight-time-offset)) |
349 (calendar-nth-named-day 1 0 4 year)))) | 350 (calendar-nth-named-day 2 0 3 year)))) |
350 | 351 |
351 (defun calendar-dst-ends (year) | 352 (defun calendar-dst-ends (year) |
352 "Return the date of YEAR on which Daylight Saving Time ends. | 353 "Return the date of YEAR on which Daylight Saving Time ends. |
353 This function respects the value of `calendar-dst-check-each-year-flag'." | 354 This function respects the value of `calendar-dst-check-each-year-flag'." |
354 (or (let ((expr (if calendar-dst-check-each-year-flag | 355 (or (let ((expr (if calendar-dst-check-each-year-flag |
355 (nth 2 (calendar-dst-find-startend year)) | 356 (nth 2 (calendar-dst-find-startend year)) |
356 (nth 5 calendar-current-time-zone-cache)))) | 357 (nth 5 calendar-current-time-zone-cache)))) |
357 (if expr (eval expr))) | 358 (if expr (eval expr))) |
358 (and (not (zerop calendar-daylight-time-offset)) | 359 (and (not (zerop calendar-daylight-time-offset)) |
359 (calendar-nth-named-day -1 0 10 year)))) | 360 (calendar-nth-named-day 1 0 11 year)))) |
360 | 361 |
361 | 362 |
362 ;;;###autoload | 363 ;;;###autoload |
363 (put 'calendar-daylight-savings-starts 'risky-local-variable t) | 364 (put 'calendar-daylight-savings-starts 'risky-local-variable t) |
364 (defvar calendar-daylight-savings-starts | 365 (defvar calendar-daylight-savings-starts |