diff options
| author | Jay Belanger | 2007-08-25 01:35:31 +0000 |
|---|---|---|
| committer | Jay Belanger | 2007-08-25 01:35:31 +0000 |
| commit | 3707a0017b003c105bb0d8f54d0233887822cc39 (patch) | |
| tree | d2b2d8765957d8f7e52ede95ef3ad96499329ef3 | |
| parent | 3baad51b54aafed6949b89f6d2eaeb1d319171ef (diff) | |
| download | emacs-3707a0017b003c105bb0d8f54d0233887822cc39.tar.gz emacs-3707a0017b003c105bb0d8f54d0233887822cc39.zip | |
(Time Zones): Explain that Calc will by default use daylight saving
time determined by the calendar.
| -rw-r--r-- | man/calc.texi | 95 |
1 files changed, 36 insertions, 59 deletions
diff --git a/man/calc.texi b/man/calc.texi index 685f945789f..194d36d8f5f 100644 --- a/man/calc.texi +++ b/man/calc.texi | |||
| @@ -17095,69 +17095,45 @@ Pacific Time look like this: | |||
| 17095 | 17095 | ||
| 17096 | @cindex @code{TimeZone} variable | 17096 | @cindex @code{TimeZone} variable |
| 17097 | @vindex TimeZone | 17097 | @vindex TimeZone |
| 17098 | With no arguments, @code{calc-time-zone} or @samp{tzone()} obtains an | 17098 | With no arguments, @code{calc-time-zone} or @samp{tzone()} will by |
| 17099 | argument from the Calc variable @code{TimeZone} if a value has been | 17099 | default get the time zone and daylight saving information from the |
| 17100 | stored for that variable. If not, Calc runs the Unix @samp{date} | 17100 | calendar (@pxref{Daylight Saving,Calendar/Diary,The Calendar and the Diary, |
| 17101 | command and looks for one of the above time zone names in the output; | 17101 | emacs,The GNU Emacs Manual}). To use a different time zone, or if the |
| 17102 | if this does not succeed, @samp{tzone()} leaves itself unevaluated. | 17102 | calendar does not give the desired result, you can set the Calc variable |
| 17103 | The time zone name in the @samp{date} output may be followed by a signed | 17103 | @code{TimeZone} (which is by default @code{nil}) to an appropriate |
| 17104 | adjustment, e.g., @samp{GMT+5} or @samp{GMT+0500} which specifies a | 17104 | time zone name. (The easiest way to do this is to edit the |
| 17105 | number of hours and minutes to be added to the base time zone. | 17105 | @code{TimeZone} variable using Calc's @kbd{s T} command, then use the |
| 17106 | Calc stores the time zone it finds into @code{TimeZone} to speed | 17106 | @kbd{s p} (@code{calc-permanent-variable}) command to save the value of |
| 17107 | later calls to @samp{tzone()}. | 17107 | @code{TimeZone} permanently.) |
| 17108 | 17108 | If the time zone given by @code{TimeZone} is a generalized time zone, | |
| 17109 | The special time zone name @code{local} is equivalent to no argument, | 17109 | e.g., @code{EGT}, Calc examines the date being converted to tell whether |
| 17110 | i.e., it uses the local time zone as obtained from the @code{date} | 17110 | to use standard or daylight saving time. But if the current time zone |
| 17111 | command. | 17111 | is explicit, e.g., @code{EST} or @code{EDT}, then that adjustment is |
| 17112 | 17112 | used exactly and Calc's daylight saving algorithm is not consulted. | |
| 17113 | If the time zone name found is one of the standard or daylight | 17113 | The special time zone name @code{local} |
| 17114 | saving zone names from the above table, and Calc's internal | 17114 | is equivalent to no argument; i.e., it uses the information obtained |
| 17115 | daylight saving algorithm says that time and zone are consistent | 17115 | from the calendar. |
| 17116 | (e.g., @code{PDT} accompanies a date that Calc's algorithm would also | ||
| 17117 | consider to be daylight saving, or @code{PST} accompanies a date | ||
| 17118 | that Calc would consider to be standard time), then Calc substitutes | ||
| 17119 | the corresponding generalized time zone (like @code{PGT}). | ||
| 17120 | |||
| 17121 | If your system does not have a suitable @samp{date} command, you | ||
| 17122 | may wish to put a @samp{(setq var-TimeZone ...)} in your Emacs | ||
| 17123 | initialization file to set the time zone. (Since you are interacting | ||
| 17124 | with the variable @code{TimeZone} directly from Emacs Lisp, the | ||
| 17125 | @code{var-} prefix needs to be present.) The easiest way to do | ||
| 17126 | this is to edit the @code{TimeZone} variable using Calc's @kbd{s T} | ||
| 17127 | command, then use the @kbd{s p} (@code{calc-permanent-variable}) | ||
| 17128 | command to save the value of @code{TimeZone} permanently. | ||
| 17129 | 17116 | ||
| 17130 | The @kbd{t J} and @code{t U} commands with no numeric prefix | 17117 | The @kbd{t J} and @code{t U} commands with no numeric prefix |
| 17131 | arguments do the same thing as @samp{tzone()}. If the current | 17118 | arguments do the same thing as @samp{tzone()}; namely, use the |
| 17132 | time zone is a generalized time zone, e.g., @code{EGT}, Calc | 17119 | information from the calendar if @code{TimeZone} is @code{nil}, |
| 17133 | examines the date being converted to tell whether to use standard | 17120 | otherwise use the time zone given by @code{TimeZone}. |
| 17134 | or daylight saving time. But if the current time zone is explicit, | ||
| 17135 | e.g., @code{EST} or @code{EDT}, then that adjustment is used exactly | ||
| 17136 | and Calc's daylight saving algorithm is not consulted. | ||
| 17137 | |||
| 17138 | Some places don't follow the usual rules for daylight saving time. | ||
| 17139 | The state of Arizona, for example, does not observe daylight saving | ||
| 17140 | time. If you run Calc during the winter season in Arizona, the | ||
| 17141 | Unix @code{date} command will report @code{MST} time zone, which | ||
| 17142 | Calc will change to @code{MGT}. If you then convert a time that | ||
| 17143 | lies in the summer months, Calc will apply an incorrect daylight | ||
| 17144 | saving time adjustment. To avoid this, set your @code{TimeZone} | ||
| 17145 | variable explicitly to @code{MST} to force the use of standard, | ||
| 17146 | non-daylight-saving time. | ||
| 17147 | 17121 | ||
| 17148 | @vindex math-daylight-savings-hook | 17122 | @vindex math-daylight-savings-hook |
| 17149 | @findex math-std-daylight-savings | 17123 | @findex math-std-daylight-savings |
| 17150 | By default Calc always considers daylight saving time to begin at | 17124 | When Calc computes the daylight saving information itself (i.e., when |
| 17151 | 2 a.m.@: on the second Sunday of March (for years from 2007 on) or on | 17125 | the @code{TimeZone} variable is set), it will by default consider |
| 17152 | the last Sunday in April (for years before 2007), and to end at 2 a.m.@: | 17126 | daylight saving time to begin at 2 a.m.@: on the second Sunday of March |
| 17153 | on the first Sunday of November. (for years from 2007 on) or the last | 17127 | (for years from 2007 on) or on the last Sunday in April (for years |
| 17154 | Sunday in October (for years before 2007). These are the rules that have | 17128 | before 2007), and to end at 2 a.m.@: on the first Sunday of |
| 17155 | been in effect in much of North America since 1966 and takes into | 17129 | November. (for years from 2007 on) or the last Sunday in October (for |
| 17156 | account the rule change that began in 2007. If you are in a | 17130 | years before 2007). These are the rules that have been in effect in |
| 17157 | country that uses different rules for computing daylight saving time, | 17131 | much of North America since 1966 and take into account the rule change |
| 17158 | you have two choices: Write your own daylight saving hook, or control | 17132 | that began in 2007. If you are in a country that uses different rules |
| 17159 | time zones explicitly by setting the @code{TimeZone} variable and/or | 17133 | for computing daylight saving time, you have two choices: Write your own |
| 17160 | always giving a time-zone argument for the conversion functions. | 17134 | daylight saving hook, or control time zones explicitly by setting the |
| 17135 | @code{TimeZone} variable and/or always giving a time-zone argument for | ||
| 17136 | the conversion functions. | ||
| 17161 | 17137 | ||
| 17162 | The Lisp variable @code{math-daylight-savings-hook} holds the | 17138 | The Lisp variable @code{math-daylight-savings-hook} holds the |
| 17163 | name of a function that is used to compute the daylight saving | 17139 | name of a function that is used to compute the daylight saving |
| @@ -17221,7 +17197,8 @@ falls in this hour results in a time value for the following hour, | |||
| 17221 | from 3 a.m.@: to 4 a.m. At the end of daylight saving time, the | 17197 | from 3 a.m.@: to 4 a.m. At the end of daylight saving time, the |
| 17222 | hour from 1 a.m.@: to 2 a.m.@: repeats itself; converting a date/time | 17198 | hour from 1 a.m.@: to 2 a.m.@: repeats itself; converting a date/time |
| 17223 | form that falls in this hour results in a time value for the first | 17199 | form that falls in this hour results in a time value for the first |
| 17224 | manifestation of that time (@emph{not} the one that occurs one hour later). | 17200 | manifestation of that time (@emph{not} the one that occurs one hour |
| 17201 | later). | ||
| 17225 | 17202 | ||
| 17226 | If @code{math-daylight-savings-hook} is @code{nil}, then the | 17203 | If @code{math-daylight-savings-hook} is @code{nil}, then the |
| 17227 | daylight saving adjustment is always taken to be zero. | 17204 | daylight saving adjustment is always taken to be zero. |