diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/cmdargs.texi | 5 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 67 |
2 files changed, 45 insertions, 27 deletions
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 646c8da1bb8..444d30527f8 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi | |||
| @@ -641,8 +641,9 @@ to put temporary files (@pxref{Backup}). Emacs tries to use | |||
| 641 | @env{TMP}, then @env{TEMP}, and finally @file{c:/temp}. | 641 | @env{TMP}, then @env{TEMP}, and finally @file{c:/temp}. |
| 642 | @item TZ | 642 | @item TZ |
| 643 | @vindex TZ, environment variable | 643 | @vindex TZ, environment variable |
| 644 | This specifies the current time zone and possibly also daylight | 644 | This specifies the default time zone and possibly also daylight |
| 645 | saving time information. On MS-DOS, if @env{TZ} is not set in the | 645 | saving time information. @xref{Time Zone Rules,,, elisp, The GNU |
| 646 | Emacs Lisp Reference Manual}. On MS-DOS, if @env{TZ} is not set in the | ||
| 646 | environment when Emacs starts, Emacs defines a default value as | 647 | environment when Emacs starts, Emacs defines a default value as |
| 647 | appropriate for the country code returned by DOS@. On MS-Windows, Emacs | 648 | appropriate for the country code returned by DOS@. On MS-Windows, Emacs |
| 648 | does not use @env{TZ} at all. | 649 | does not use @env{TZ} at all. |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 03d04ba3cf3..6e0edec2943 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -19,6 +19,7 @@ terminal and the screen. | |||
| 19 | * System Environment:: Distinguish the name and kind of system. | 19 | * System Environment:: Distinguish the name and kind of system. |
| 20 | * User Identification:: Finding the name and user id of the user. | 20 | * User Identification:: Finding the name and user id of the user. |
| 21 | * Time of Day:: Getting the current time. | 21 | * Time of Day:: Getting the current time. |
| 22 | * Time Zone Rules:: Rules for time zones and daylight saving time. | ||
| 22 | * Time Conversion:: Converting a time from numeric form to | 23 | * Time Conversion:: Converting a time from numeric form to |
| 23 | calendrical data and vice versa. | 24 | calendrical data and vice versa. |
| 24 | * Time Parsing:: Converting a time from numeric form to text | 25 | * Time Parsing:: Converting a time from numeric form to text |
| @@ -1259,7 +1260,7 @@ information may some day be added at the end. | |||
| 1259 | 1260 | ||
| 1260 | The argument @var{time}, if given, specifies a time to format, | 1261 | The argument @var{time}, if given, specifies a time to format, |
| 1261 | instead of the current time. The optional argument @var{zone} | 1262 | instead of the current time. The optional argument @var{zone} |
| 1262 | defaults to the current time zone rule. | 1263 | defaults to the current time zone rule. @xref{Time Zone Rules}. |
| 1263 | 1264 | ||
| 1264 | @example | 1265 | @example |
| 1265 | @group | 1266 | @group |
| @@ -1296,26 +1297,9 @@ For example, if @var{time} is a number, @code{(time-to-seconds | |||
| 1296 | or rounding errors occur. | 1297 | or rounding errors occur. |
| 1297 | @end defun | 1298 | @end defun |
| 1298 | 1299 | ||
| 1299 | @defun current-time-zone &optional time zone | 1300 | @node Time Zone Rules |
| 1300 | @cindex time zone, current | 1301 | @section Time Zone Rules |
| 1301 | This function returns a list describing the time zone that the user is | 1302 | @cindex time zone rules |
| 1302 | in. | ||
| 1303 | |||
| 1304 | The value has the form @code{(@var{offset} @var{name})}. Here | ||
| 1305 | @var{offset} is an integer giving the number of seconds ahead of Universal Time | ||
| 1306 | (east of Greenwich). A negative value means west of Greenwich. The | ||
| 1307 | second element, @var{name}, is a string giving the name of the time | ||
| 1308 | zone. Both elements change when daylight saving time begins or ends; | ||
| 1309 | if the user has specified a time zone that does not use a seasonal time | ||
| 1310 | adjustment, then the value is constant through time. | ||
| 1311 | |||
| 1312 | If the operating system doesn't supply all the information necessary to | ||
| 1313 | compute the value, the unknown elements of the list are @code{nil}. | ||
| 1314 | |||
| 1315 | The argument @var{time}, if given, specifies a time value to | ||
| 1316 | analyze instead of the current time. The optional argument @var{zone} | ||
| 1317 | defaults to the current time zone rule. | ||
| 1318 | @end defun | ||
| 1319 | 1303 | ||
| 1320 | @vindex TZ, environment variable | 1304 | @vindex TZ, environment variable |
| 1321 | The default time zone is determined by the @env{TZ} environment | 1305 | The default time zone is determined by the @env{TZ} environment |
| @@ -1324,6 +1308,15 @@ to default to Universal Time with @code{(setenv "TZ" "UTC0")}. If | |||
| 1324 | @env{TZ} is not in the environment, Emacs uses system wall clock time, | 1308 | @env{TZ} is not in the environment, Emacs uses system wall clock time, |
| 1325 | which is a platform-dependent default time zone. | 1309 | which is a platform-dependent default time zone. |
| 1326 | 1310 | ||
| 1311 | The set of supported @env{TZ} strings is system-dependent. GNU and | ||
| 1312 | many other systems support the tzdata database, e.g., | ||
| 1313 | @samp{"America/New_York"} specifies the time zone and daylight saving | ||
| 1314 | time history for locations near New York City. GNU and most other | ||
| 1315 | systems support POSIX-style @env{TZ} strings, e.g., | ||
| 1316 | @samp{"EST+5EDT,M4.1.0/2,M10.5.0/2"} specifies the rules used in New | ||
| 1317 | York from 1987 through 2006. All systems support the string | ||
| 1318 | @samp{"UTC0"} meaning Universal Time. | ||
| 1319 | |||
| 1327 | @cindex time zone rule | 1320 | @cindex time zone rule |
| 1328 | Functions that convert to and from local time accept an optional | 1321 | Functions that convert to and from local time accept an optional |
| 1329 | @dfn{time zone rule} argument, which specifies the conversion's time | 1322 | @dfn{time zone rule} argument, which specifies the conversion's time |
| @@ -1334,6 +1327,29 @@ If it is @code{t}, the conversion uses Universal Time. If it is | |||
| 1334 | a string, the conversion uses the time zone rule equivalent to setting | 1327 | a string, the conversion uses the time zone rule equivalent to setting |
| 1335 | @env{TZ} to that string. | 1328 | @env{TZ} to that string. |
| 1336 | 1329 | ||
| 1330 | @defun current-time-zone &optional time zone | ||
| 1331 | @cindex time zone, current | ||
| 1332 | This function returns a list describing the time zone that the user is | ||
| 1333 | in. | ||
| 1334 | |||
| 1335 | The value has the form @code{(@var{offset} @var{abbr})}. Here | ||
| 1336 | @var{offset} is an integer giving the number of seconds ahead of Universal Time | ||
| 1337 | (east of Greenwich). A negative value means west of Greenwich. The | ||
| 1338 | second element, @var{abbr}, is a string giving an abbreviation for the | ||
| 1339 | time zone, e.g., @samp{"CST"} for China Standard Time or for | ||
| 1340 | U.S. Central Standard Time. Both elements can change when daylight | ||
| 1341 | saving time begins or ends; if the user has specified a time zone that | ||
| 1342 | does not use a seasonal time adjustment, then the value is constant | ||
| 1343 | through time. | ||
| 1344 | |||
| 1345 | If the operating system doesn't supply all the information necessary to | ||
| 1346 | compute the value, the unknown elements of the list are @code{nil}. | ||
| 1347 | |||
| 1348 | The argument @var{time}, if given, specifies a time value to | ||
| 1349 | analyze instead of the current time. The optional argument @var{zone} | ||
| 1350 | defaults to the current time zone rule. | ||
| 1351 | @end defun | ||
| 1352 | |||
| 1337 | @node Time Conversion | 1353 | @node Time Conversion |
| 1338 | @section Time Conversion | 1354 | @section Time Conversion |
| 1339 | @cindex calendrical information | 1355 | @cindex calendrical information |
| @@ -1358,8 +1374,8 @@ as traditional Gregorian years do; for example, the year number | |||
| 1358 | @defun decode-time &optional time zone | 1374 | @defun decode-time &optional time zone |
| 1359 | This function converts a time value into calendrical information. If | 1375 | This function converts a time value into calendrical information. If |
| 1360 | you don't specify @var{time}, it decodes the current time, and similarly | 1376 | you don't specify @var{time}, it decodes the current time, and similarly |
| 1361 | @var{zone} defaults to the current time zone rule. The return | 1377 | @var{zone} defaults to the current time zone rule. @xref{Time Zone Rules}. |
| 1362 | value is a list of nine elements, as follows: | 1378 | The return value is a list of nine elements, as follows: |
| 1363 | 1379 | ||
| 1364 | @example | 1380 | @example |
| 1365 | (@var{seconds} @var{minutes} @var{hour} @var{day} @var{month} @var{year} @var{dow} @var{dst} @var{utcoff}) | 1381 | (@var{seconds} @var{minutes} @var{hour} @var{day} @var{month} @var{year} @var{dow} @var{dst} @var{utcoff}) |
| @@ -1406,6 +1422,7 @@ to stand for years above 1900, or years above 2000, you must alter them | |||
| 1406 | yourself before you call @code{encode-time}. | 1422 | yourself before you call @code{encode-time}. |
| 1407 | 1423 | ||
| 1408 | The optional argument @var{zone} defaults to the current time zone rule. | 1424 | The optional argument @var{zone} defaults to the current time zone rule. |
| 1425 | @xref{Time Zone Rules}. | ||
| 1409 | In addition to the usual time zone rule values, it can also be a list | 1426 | In addition to the usual time zone rule values, it can also be a list |
| 1410 | (as you would get from @code{current-time-zone}) or an integer (as | 1427 | (as you would get from @code{current-time-zone}) or an integer (as |
| 1411 | from @code{decode-time}), applied without any further alteration for | 1428 | from @code{decode-time}), applied without any further alteration for |
| @@ -1449,8 +1466,8 @@ corresponding time value. | |||
| 1449 | 1466 | ||
| 1450 | This function converts @var{time} (or the current time, if | 1467 | This function converts @var{time} (or the current time, if |
| 1451 | @var{time} is omitted) to a string according to | 1468 | @var{time} is omitted) to a string according to |
| 1452 | @var{format-string}. The conversion uses the time zone rule @var{zone} | 1469 | @var{format-string}. The conversion uses the time zone rule @var{zone}, which |
| 1453 | (or the current time zone rule, if omitted). The argument | 1470 | defaults to the current time zone rule. @xref{Time Zone Rules}. The argument |
| 1454 | @var{format-string} may contain @samp{%}-sequences which say to | 1471 | @var{format-string} may contain @samp{%}-sequences which say to |
| 1455 | substitute parts of the time. Here is a table of what the | 1472 | substitute parts of the time. Here is a table of what the |
| 1456 | @samp{%}-sequences mean: | 1473 | @samp{%}-sequences mean: |