Previous: , Up: Current Time   [Index]


I.2.1.2 Time Zones

Default Time Zone

The default time zone is determined by the ‘TZ’ environment variable. If ‘TZ’ is not in the environment, Emacs uses system wall clock time, which is a platform-dependent default time zone.

You can tell Emacs to default to Universal Time with ‘(setenv "TZ" "UTC0")’.

TZ Strings

The set of supported ‘TZ’ strings is system-dependent. GNU and many other systems support the ‘tzdata’ database (tzdata). GNU and most other systems support POSIX-style ‘TZ’ strings. All systems support the string ‘"UTC0"’ meaning Universal Time.

Functions Using Time Zone

Functions that convert to and from local time accept an optional time zone rule argument, which specifies the conversion’s time zone and daylight saving time history.

NIL

the conversion uses Emacs’s default time zone

t

the conversion uses Universal Time

wall

the conversion uses the system wall clock time

string

the conversion uses the time zone rule equivalent to setting ‘TZ’ to that string

list ‘(offset abbr)

where ‘offset’ is an integer number of seconds east of Universal Time and ‘abbr’ is a string, the conversion uses a fixed time zone with the given offset and abbreviation

integer

An integer offset is treated as if it were ‘(offset abbr)’, where ‘abbr’ is a numeric abbreviation on POSIX-compatible platforms

Function: current-time-zone &optional TIME ZONE

This function returns a list describing the time zone that the user is in.

The value has the form ‘(offset abbr)’. Here ‘offset’ is an integer giving the number of seconds ahead of Universal Time (east of Greenwich). A negative value means west of Greenwich. Both elements can change when daylight saving time begins or ends;


Previous: Lisp Timestamp, Up: Current Time   [Index]