Mercurial > emacs
comparison lisp/calendar/calendar.el @ 2997:890e8e99a932
(calendar-daylight-savings-starts, calendar-daylight-savings-ends):
Default to nil if the locale never has DST.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 24 May 1993 00:00:19 +0000 |
parents | c47652dc3400 |
children | b7d345eaae47 |
comparison
equal
deleted
inserted
replaced
2996:358fe58ae153 | 2997:890e8e99a932 |
---|---|
487 OFFSET is an integer specifying how many minutes east of Greenwich the | 487 OFFSET is an integer specifying how many minutes east of Greenwich the |
488 current time zone is located. A negative value means west of | 488 current time zone is located. A negative value means west of |
489 Greenwich. This describes the standard time; if daylight | 489 Greenwich. This describes the standard time; if daylight |
490 savings time is in effect, it does not affect this value. | 490 savings time is in effect, it does not affect this value. |
491 SAVINGS-FLAG is non-nil iff daylight savings time or some other sort | 491 SAVINGS-FLAG is non-nil iff daylight savings time or some other sort |
492 of seasonal time adjustment is in effect. | 492 of seasonal time adjustment is ever in effect. |
493 STANDARD is a string giving the name of the time zone when no seasonal | 493 STANDARD is a string giving the name of the time zone when no seasonal |
494 time adjustment is in effect. | 494 time adjustment is in effect. |
495 SAVINGS is a string giving the name of the time zone when there is a | 495 SAVINGS is a string giving the name of the time zone when there is a |
496 seasonal time adjustment in effect. | 496 seasonal time adjustment in effect. |
497 If the local area does not use a seasonal time adjustment, | 497 If the local area does not use a seasonal time adjustment, |
498 SAVINGS-FLAG is always nil, and STANDARD and SAVINGS are equal. | 498 SAVINGS-FLAG is always nil, and STANDARD and SAVINGS are equal. |
499 | 499 |
500 Some operating systems cannot provide all this information to Emacs; | 500 Some operating systems cannot provide all this information to Emacs; |
501 in this case, calendar-current-time-zone returns a list containing nil for | 501 in this case, `calendar-current-time-zone' returns a list containing nil for |
502 the data it can't find." | 502 the data it can't find." |
503 (let* ((quarter-year-seconds 7889238.0) ; # number of seconds in 1/4 year | 503 (let* ((quarter-year-seconds 7889238.0) ; # number of seconds in 1/4 year |
504 (current-time-arithmetic-base 65536.0) | 504 (current-time-arithmetic-base 65536.0) |
505 (now (current-time)) | 505 (now (current-time)) |
506 (now-zone (current-time-zone now)) | 506 (now-zone (current-time-zone now)) |
571 (or calendar-daylight-time-zone-name | 571 (or calendar-daylight-time-zone-name |
572 (setq calendar-daylight-time-zone-name | 572 (setq calendar-daylight-time-zone-name |
573 (car (nthcdr 3 (calendar-current-time-zone))))) | 573 (car (nthcdr 3 (calendar-current-time-zone))))) |
574 | 574 |
575 ;;;###autoload | 575 ;;;###autoload |
576 (defvar calendar-daylight-savings-starts | 576 (defvar calendar-daylight-savings-starts nil |
577 '(calendar-nth-named-day 1 0 4 year) | |
578 "*A sexp in the variable `year' that gives the Gregorian date, in the form | 577 "*A sexp in the variable `year' that gives the Gregorian date, in the form |
579 of a list (month day year), on which daylight savings time starts. This is | 578 of a list (month day year), on which daylight savings time starts. This is |
580 used to determine the starting date of daylight savings time for the holiday | 579 used to determine the starting date of daylight savings time for the holiday |
581 list and for correcting times of day in the solar and lunar calculations. The | 580 list and for correcting times of day in the solar and lunar calculations. |
582 default value is the American rule of the first Sunday in April. | |
583 | 581 |
584 For example, if daylight savings time is mandated to start on October 1, | 582 For example, if daylight savings time is mandated to start on October 1, |
585 you would set `calendar-daylight-savings-starts' to | 583 you would set `calendar-daylight-savings-starts' to |
586 | 584 |
587 '(10 1 year) | 585 '(10 1 year) |
592 | 590 |
593 '(calendar-gregorian-from-absolute | 591 '(calendar-gregorian-from-absolute |
594 (calendar-absolute-from-hebrew | 592 (calendar-absolute-from-hebrew |
595 (list 1 1 (+ year 3760)))) | 593 (list 1 1 (+ year 3760)))) |
596 | 594 |
597 because Nisan is the first month in the Hebrew calendar.") | 595 because Nisan is the first month in the Hebrew calendar. |
598 | 596 |
599 ;;;###autoload | 597 If this is nil and the locale ever uses daylight savings time, |
600 (defvar calendar-daylight-savings-ends | 598 it will be set to the American rule of the first Sunday in April |
601 '(calendar-nth-named-day -1 0 10 year) | 599 when the calendar package loads.") |
600 ;;; If the user has given this a value, don't wipe it out. | |
601 (or calendar-daylight-savings-starts | |
602 (setq calendar-daylight-savings-starts | |
603 (and (car (cdr (calendar-current-time-zone))) | |
604 '(calendar-nth-named-day 1 0 4 year)))) | |
605 | |
606 ;;;###autoload | |
607 (defvar calendar-daylight-savings-ends nil | |
602 "*An expression in the variable `year' that gives the Gregorian date, in the | 608 "*An expression in the variable `year' that gives the Gregorian date, in the |
603 form of a list (month day year), on which daylight savings time ends. This | 609 form of a list (month day year), on which daylight savings time ends. This |
604 is used to determine the ending date of daylight savings time for the holiday | 610 is used to determine the ending date of daylight savings time for the holiday |
605 list and for correcting times of day in the solar and lunar calculations. | 611 list and for correcting times of day in the solar and lunar calculations. |
606 The default value is the American rule of the last Sunday in October. | 612 The default value is the American rule of the last Sunday in October |
613 if the locale ever uses daylight savings time, otherwise nil. | |
607 See the documentation for `calendar-daylight-savings-starts' for other | 614 See the documentation for `calendar-daylight-savings-starts' for other |
608 examples.") | 615 examples.") |
616 ;;; If the user has given this a value, don't wipe it out. | |
617 (or calendar-daylight-savings-ends | |
618 (setq calendar-daylight-savings-ends | |
619 (and (car (cdr (calendar-current-time-zone))) | |
620 '(calendar-nth-named-day -1 0 10 year)))) | |
609 | 621 |
610 (defun european-calendar () | 622 (defun european-calendar () |
611 "Set the interpretation and display of dates to the European style." | 623 "Set the interpretation and display of dates to the European style." |
612 (interactive) | 624 (interactive) |
613 (setq european-calendar-style t) | 625 (setq european-calendar-style t) |