diff options
| author | Chong Yidong | 2007-03-17 18:35:08 +0000 |
|---|---|---|
| committer | Chong Yidong | 2007-03-17 18:35:08 +0000 |
| commit | 9d85aece8ba3d4c4231d669a695f3bb24052a8ca (patch) | |
| tree | 4e64e9f748187f670d44b6ed1db2c9c26c83d83d | |
| parent | 9c279ddfbaef5e25119f08cb555a036cf0c22c7e (diff) | |
| download | emacs-9d85aece8ba3d4c4231d669a695f3bb24052a8ca.tar.gz emacs-9d85aece8ba3d4c4231d669a695f3bb24052a8ca.zip | |
(Time Zones): Switch to new North America DST rule.
Fix "daylight savings time" -> "daylight saving time" typo throughout.
| -rw-r--r-- | man/calc.texi | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/man/calc.texi b/man/calc.texi index ca7167905cb..d927346ff6b 100644 --- a/man/calc.texi +++ b/man/calc.texi | |||
| @@ -17364,31 +17364,31 @@ business day. | |||
| 17364 | 17364 | ||
| 17365 | @noindent | 17365 | @noindent |
| 17366 | @cindex Time zones | 17366 | @cindex Time zones |
| 17367 | @cindex Daylight savings time | 17367 | @cindex Daylight saving time |
| 17368 | Time zones and daylight savings time are a complicated business. | 17368 | Time zones and daylight saving time are a complicated business. |
| 17369 | The conversions to and from Julian and Unix-style dates automatically | 17369 | The conversions to and from Julian and Unix-style dates automatically |
| 17370 | compute the correct time zone and daylight savings adjustment to use, | 17370 | compute the correct time zone and daylight saving adjustment to use, |
| 17371 | provided they can figure out this information. This section describes | 17371 | provided they can figure out this information. This section describes |
| 17372 | Calc's time zone adjustment algorithm in detail, in case you want to | 17372 | Calc's time zone adjustment algorithm in detail, in case you want to |
| 17373 | do conversions in different time zones or in case Calc's algorithms | 17373 | do conversions in different time zones or in case Calc's algorithms |
| 17374 | can't determine the right correction to use. | 17374 | can't determine the right correction to use. |
| 17375 | 17375 | ||
| 17376 | Adjustments for time zones and daylight savings time are done by | 17376 | Adjustments for time zones and daylight saving time are done by |
| 17377 | @kbd{t U}, @kbd{t J}, @kbd{t N}, and @kbd{t C}, but not by any other | 17377 | @kbd{t U}, @kbd{t J}, @kbd{t N}, and @kbd{t C}, but not by any other |
| 17378 | commands. In particular, @samp{<may 1 1991> - <apr 1 1991>} evaluates | 17378 | commands. In particular, @samp{<may 1 1991> - <apr 1 1991>} evaluates |
| 17379 | to exactly 30 days even though there is a daylight-savings | 17379 | to exactly 30 days even though there is a daylight-saving |
| 17380 | transition in between. This is also true for Julian pure dates: | 17380 | transition in between. This is also true for Julian pure dates: |
| 17381 | @samp{julian(<may 1 1991>) - julian(<apr 1 1991>)}. But Julian | 17381 | @samp{julian(<may 1 1991>) - julian(<apr 1 1991>)}. But Julian |
| 17382 | and Unix date/times will adjust for daylight savings time: | 17382 | and Unix date/times will adjust for daylight saving time: |
| 17383 | @samp{julian(<12am may 1 1991>) - julian(<12am apr 1 1991>)} | 17383 | @samp{julian(<12am may 1 1991>) - julian(<12am apr 1 1991>)} |
| 17384 | evaluates to @samp{29.95834} (that's 29 days and 23 hours) | 17384 | evaluates to @samp{29.95834} (that's 29 days and 23 hours) |
| 17385 | because one hour was lost when daylight savings commenced on | 17385 | because one hour was lost when daylight saving commenced on |
| 17386 | April 7, 1991. | 17386 | April 7, 1991. |
| 17387 | 17387 | ||
| 17388 | In brief, the idiom @samp{julian(@var{date1}) - julian(@var{date2})} | 17388 | In brief, the idiom @samp{julian(@var{date1}) - julian(@var{date2})} |
| 17389 | computes the actual number of 24-hour periods between two dates, whereas | 17389 | computes the actual number of 24-hour periods between two dates, whereas |
| 17390 | @samp{@var{date1} - @var{date2}} computes the number of calendar | 17390 | @samp{@var{date1} - @var{date2}} computes the number of calendar |
| 17391 | days between two dates without taking daylight savings into account. | 17391 | days between two dates without taking daylight saving into account. |
| 17392 | 17392 | ||
| 17393 | @pindex calc-time-zone | 17393 | @pindex calc-time-zone |
| 17394 | @ignore | 17394 | @ignore |
| @@ -17400,7 +17400,7 @@ zone specified by its numeric prefix argument into a number of | |||
| 17400 | seconds difference from Greenwich mean time (GMT). If the argument | 17400 | seconds difference from Greenwich mean time (GMT). If the argument |
| 17401 | is a number, the result is simply that value multiplied by 3600. | 17401 | is a number, the result is simply that value multiplied by 3600. |
| 17402 | Typical arguments for North America are 5 (Eastern) or 8 (Pacific). If | 17402 | Typical arguments for North America are 5 (Eastern) or 8 (Pacific). If |
| 17403 | Daylight Savings time is in effect, one hour should be subtracted from | 17403 | Daylight Saving time is in effect, one hour should be subtracted from |
| 17404 | the normal difference. | 17404 | the normal difference. |
| 17405 | 17405 | ||
| 17406 | If you give a prefix of plain @kbd{C-u}, @code{calc-time-zone} (like other | 17406 | If you give a prefix of plain @kbd{C-u}, @code{calc-time-zone} (like other |
| @@ -17411,12 +17411,12 @@ stack position.) This allows you to give a non-integer time zone | |||
| 17411 | adjustment. The time-zone argument can also be an HMS form, or | 17411 | adjustment. The time-zone argument can also be an HMS form, or |
| 17412 | it can be a variable which is a time zone name in upper- or lower-case. | 17412 | it can be a variable which is a time zone name in upper- or lower-case. |
| 17413 | For example @samp{tzone(PST) = tzone(8)} and @samp{tzone(pdt) = tzone(7)} | 17413 | For example @samp{tzone(PST) = tzone(8)} and @samp{tzone(pdt) = tzone(7)} |
| 17414 | (for Pacific standard and daylight savings times, respectively). | 17414 | (for Pacific standard and daylight saving times, respectively). |
| 17415 | 17415 | ||
| 17416 | North American and European time zone names are defined as follows; | 17416 | North American and European time zone names are defined as follows; |
| 17417 | note that for each time zone there is one name for standard time, | 17417 | note that for each time zone there is one name for standard time, |
| 17418 | another for daylight savings time, and a third for ``generalized'' time | 17418 | another for daylight saving time, and a third for ``generalized'' time |
| 17419 | in which the daylight savings adjustment is computed from context. | 17419 | in which the daylight saving adjustment is computed from context. |
| 17420 | 17420 | ||
| 17421 | @smallexample | 17421 | @smallexample |
| 17422 | @group | 17422 | @group |
| @@ -17441,7 +17441,7 @@ Pacific Time look like this: | |||
| 17441 | @smallexample | 17441 | @smallexample |
| 17442 | @group | 17442 | @group |
| 17443 | ( ( "PST" 8 0 ) ; Name as an upper-case string, then standard | 17443 | ( ( "PST" 8 0 ) ; Name as an upper-case string, then standard |
| 17444 | ( "PDT" 8 -1 ) ; adjustment, then daylight savings adjustment. | 17444 | ( "PDT" 8 -1 ) ; adjustment, then daylight saving adjustment. |
| 17445 | ( "PGT" 8 "PST" "PDT" ) ) ; Generalized time zone. | 17445 | ( "PGT" 8 "PST" "PDT" ) ) ; Generalized time zone. |
| 17446 | @end group | 17446 | @end group |
| 17447 | @end smallexample | 17447 | @end smallexample |
| @@ -17464,10 +17464,10 @@ i.e., it uses the local time zone as obtained from the @code{date} | |||
| 17464 | command. | 17464 | command. |
| 17465 | 17465 | ||
| 17466 | If the time zone name found is one of the standard or daylight | 17466 | If the time zone name found is one of the standard or daylight |
| 17467 | savings zone names from the above table, and Calc's internal | 17467 | saving zone names from the above table, and Calc's internal |
| 17468 | daylight savings algorithm says that time and zone are consistent | 17468 | daylight saving algorithm says that time and zone are consistent |
| 17469 | (e.g., @code{PDT} accompanies a date that Calc's algorithm would also | 17469 | (e.g., @code{PDT} accompanies a date that Calc's algorithm would also |
| 17470 | consider to be daylight savings, or @code{PST} accompanies a date | 17470 | consider to be daylight saving, or @code{PST} accompanies a date |
| 17471 | that Calc would consider to be standard time), then Calc substitutes | 17471 | that Calc would consider to be standard time), then Calc substitutes |
| 17472 | the corresponding generalized time zone (like @code{PGT}). | 17472 | the corresponding generalized time zone (like @code{PGT}). |
| 17473 | 17473 | ||
| @@ -17484,38 +17484,38 @@ The @kbd{t J} and @code{t U} commands with no numeric prefix | |||
| 17484 | arguments do the same thing as @samp{tzone()}. If the current | 17484 | arguments do the same thing as @samp{tzone()}. If the current |
| 17485 | time zone is a generalized time zone, e.g., @code{EGT}, Calc | 17485 | time zone is a generalized time zone, e.g., @code{EGT}, Calc |
| 17486 | examines the date being converted to tell whether to use standard | 17486 | examines the date being converted to tell whether to use standard |
| 17487 | or daylight savings time. But if the current time zone is explicit, | 17487 | or daylight saving time. But if the current time zone is explicit, |
| 17488 | e.g., @code{EST} or @code{EDT}, then that adjustment is used exactly | 17488 | e.g., @code{EST} or @code{EDT}, then that adjustment is used exactly |
| 17489 | and Calc's daylight savings algorithm is not consulted. | 17489 | and Calc's daylight saving algorithm is not consulted. |
| 17490 | 17490 | ||
| 17491 | Some places don't follow the usual rules for daylight savings time. | 17491 | Some places don't follow the usual rules for daylight saving time. |
| 17492 | The state of Arizona, for example, does not observe daylight savings | 17492 | The state of Arizona, for example, does not observe daylight saving |
| 17493 | time. If you run Calc during the winter season in Arizona, the | 17493 | time. If you run Calc during the winter season in Arizona, the |
| 17494 | Unix @code{date} command will report @code{MST} time zone, which | 17494 | Unix @code{date} command will report @code{MST} time zone, which |
| 17495 | Calc will change to @code{MGT}. If you then convert a time that | 17495 | Calc will change to @code{MGT}. If you then convert a time that |
| 17496 | lies in the summer months, Calc will apply an incorrect daylight | 17496 | lies in the summer months, Calc will apply an incorrect daylight |
| 17497 | savings time adjustment. To avoid this, set your @code{TimeZone} | 17497 | saving time adjustment. To avoid this, set your @code{TimeZone} |
| 17498 | variable explicitly to @code{MST} to force the use of standard, | 17498 | variable explicitly to @code{MST} to force the use of standard, |
| 17499 | non-daylight-savings time. | 17499 | non-daylight-saving time. |
| 17500 | 17500 | ||
| 17501 | @vindex math-daylight-savings-hook | 17501 | @vindex math-daylight-savings-hook |
| 17502 | @findex math-std-daylight-savings | 17502 | @findex math-std-daylight-savings |
| 17503 | By default Calc always considers daylight savings time to begin at | 17503 | By default Calc always considers daylight saving time to begin at |
| 17504 | 2 a.m.@: on the first Sunday of April, and to end at 2 a.m.@: on the | 17504 | 2 a.m.@: on the second Sunday of March, and to end at 2 a.m.@: on the |
| 17505 | last Sunday of October. This is the rule that has been in effect | 17505 | first Sunday of November. This is the rule that has been in effect |
| 17506 | in North America since 1987. If you are in a country that uses | 17506 | in North America since 2007. If you are in a country that uses |
| 17507 | different rules for computing daylight savings time, you have two | 17507 | different rules for computing daylight saving time, you have two |
| 17508 | choices: Write your own daylight savings hook, or control time | 17508 | choices: Write your own daylight saving hook, or control time |
| 17509 | zones explicitly by setting the @code{TimeZone} variable and/or | 17509 | zones explicitly by setting the @code{TimeZone} variable and/or |
| 17510 | always giving a time-zone argument for the conversion functions. | 17510 | always giving a time-zone argument for the conversion functions. |
| 17511 | 17511 | ||
| 17512 | The Lisp variable @code{math-daylight-savings-hook} holds the | 17512 | The Lisp variable @code{math-daylight-savings-hook} holds the |
| 17513 | name of a function that is used to compute the daylight savings | 17513 | name of a function that is used to compute the daylight saving |
| 17514 | adjustment for a given date. The default is | 17514 | adjustment for a given date. The default is |
| 17515 | @code{math-std-daylight-savings}, which computes an adjustment | 17515 | @code{math-std-daylight-savings}, which computes an adjustment |
| 17516 | (either 0 or @mathit{-1}) using the North American rules given above. | 17516 | (either 0 or @mathit{-1}) using the North American rules given above. |
| 17517 | 17517 | ||
| 17518 | The daylight savings hook function is called with four arguments: | 17518 | The daylight saving hook function is called with four arguments: |
| 17519 | The date, as a floating-point number in standard Calc format; | 17519 | The date, as a floating-point number in standard Calc format; |
| 17520 | a six-element list of the date decomposed into year, month, day, | 17520 | a six-element list of the date decomposed into year, month, day, |
| 17521 | hour, minute, and second, respectively; a string which contains | 17521 | hour, minute, and second, respectively; a string which contains |
| @@ -17525,18 +17525,18 @@ converting into a generalized time zone (see below). | |||
| 17525 | 17525 | ||
| 17526 | @findex math-prev-weekday-in-month | 17526 | @findex math-prev-weekday-in-month |
| 17527 | The Lisp function @code{math-prev-weekday-in-month} is useful for | 17527 | The Lisp function @code{math-prev-weekday-in-month} is useful for |
| 17528 | daylight savings computations. This is an internal version of | 17528 | daylight saving computations. This is an internal version of |
| 17529 | the user-level @code{pwday} function described in the previous | 17529 | the user-level @code{pwday} function described in the previous |
| 17530 | section. It takes four arguments: The floating-point date value, | 17530 | section. It takes four arguments: The floating-point date value, |
| 17531 | the corresponding six-element date list, the day-of-month number, | 17531 | the corresponding six-element date list, the day-of-month number, |
| 17532 | and the weekday number (0-6). | 17532 | and the weekday number (0-6). |
| 17533 | 17533 | ||
| 17534 | The default daylight savings hook ignores the time zone name, but a | 17534 | The default daylight saving hook ignores the time zone name, but a |
| 17535 | more sophisticated hook could use different algorithms for different | 17535 | more sophisticated hook could use different algorithms for different |
| 17536 | time zones. It would also be possible to use different algorithms | 17536 | time zones. It would also be possible to use different algorithms |
| 17537 | depending on the year number, but the default hook always uses the | 17537 | depending on the year number, but the default hook always uses the |
| 17538 | algorithm for 1987 and later. Here is a listing of the default | 17538 | algorithm for 1987 and later. Here is a listing of the default |
| 17539 | daylight savings hook: | 17539 | daylight saving hook: |
| 17540 | 17540 | ||
| 17541 | @smallexample | 17541 | @smallexample |
| 17542 | (defun math-std-daylight-savings (date dt zone bump) | 17542 | (defun math-std-daylight-savings (date dt zone bump) |
| @@ -17566,25 +17566,25 @@ adjustments shown above ensure that the conversion behaves correctly | |||
| 17566 | and reasonably around the 2 a.m.@: transition in each direction. | 17566 | and reasonably around the 2 a.m.@: transition in each direction. |
| 17567 | 17567 | ||
| 17568 | There is a ``missing'' hour between 2 a.m.@: and 3 a.m.@: at the | 17568 | There is a ``missing'' hour between 2 a.m.@: and 3 a.m.@: at the |
| 17569 | beginning of daylight savings time; converting a date/time form that | 17569 | beginning of daylight saving time; converting a date/time form that |
| 17570 | falls in this hour results in a time value for the following hour, | 17570 | falls in this hour results in a time value for the following hour, |
| 17571 | from 3 a.m.@: to 4 a.m. At the end of daylight savings time, the | 17571 | from 3 a.m.@: to 4 a.m. At the end of daylight saving time, the |
| 17572 | hour from 1 a.m.@: to 2 a.m.@: repeats itself; converting a date/time | 17572 | hour from 1 a.m.@: to 2 a.m.@: repeats itself; converting a date/time |
| 17573 | form that falls in this hour results in a time value for the first | 17573 | form that falls in this hour results in a time value for the first |
| 17574 | manifestation of that time (@emph{not} the one that occurs one hour later). | 17574 | manifestation of that time (@emph{not} the one that occurs one hour later). |
| 17575 | 17575 | ||
| 17576 | If @code{math-daylight-savings-hook} is @code{nil}, then the | 17576 | If @code{math-daylight-savings-hook} is @code{nil}, then the |
| 17577 | daylight savings adjustment is always taken to be zero. | 17577 | daylight saving adjustment is always taken to be zero. |
| 17578 | 17578 | ||
| 17579 | In algebraic formulas, @samp{tzone(@var{zone}, @var{date})} | 17579 | In algebraic formulas, @samp{tzone(@var{zone}, @var{date})} |
| 17580 | computes the time zone adjustment for a given zone name at a | 17580 | computes the time zone adjustment for a given zone name at a |
| 17581 | given date. The @var{date} is ignored unless @var{zone} is a | 17581 | given date. The @var{date} is ignored unless @var{zone} is a |
| 17582 | generalized time zone. If @var{date} is a date form, the | 17582 | generalized time zone. If @var{date} is a date form, the |
| 17583 | daylight savings computation is applied to it as it appears. | 17583 | daylight saving computation is applied to it as it appears. |
| 17584 | If @var{date} is a numeric date value, it is adjusted for the | 17584 | If @var{date} is a numeric date value, it is adjusted for the |
| 17585 | daylight-savings version of @var{zone} before being given to | 17585 | daylight-saving version of @var{zone} before being given to |
| 17586 | the daylight savings hook. This odd-sounding rule ensures | 17586 | the daylight saving hook. This odd-sounding rule ensures |
| 17587 | that the daylight-savings computation is always done in | 17587 | that the daylight-saving computation is always done in |
| 17588 | local time, not in the GMT time that a numeric @var{date} | 17588 | local time, not in the GMT time that a numeric @var{date} |
| 17589 | is typically represented in. | 17589 | is typically represented in. |
| 17590 | 17590 | ||
| @@ -17593,9 +17593,9 @@ is typically represented in. | |||
| 17593 | @end ignore | 17593 | @end ignore |
| 17594 | @tindex dsadj | 17594 | @tindex dsadj |
| 17595 | The @samp{dsadj(@var{date}, @var{zone})} function computes the | 17595 | The @samp{dsadj(@var{date}, @var{zone})} function computes the |
| 17596 | daylight savings adjustment that is appropriate for @var{date} in | 17596 | daylight saving adjustment that is appropriate for @var{date} in |
| 17597 | time zone @var{zone}. If @var{zone} is explicitly in or not in | 17597 | time zone @var{zone}. If @var{zone} is explicitly in or not in |
| 17598 | daylight savings time (e.g., @code{PDT} or @code{PST}) the | 17598 | daylight saving time (e.g., @code{PDT} or @code{PST}) the |
| 17599 | @var{date} is ignored. If @var{zone} is a generalized time zone, | 17599 | @var{date} is ignored. If @var{zone} is a generalized time zone, |
| 17600 | the algorithms described above are used. If @var{zone} is omitted, | 17600 | the algorithms described above are used. If @var{zone} is omitted, |
| 17601 | the computation is done for the current time zone. | 17601 | the computation is done for the current time zone. |