-
See Also
- $SystemTimeZone
- $TimeZoneEntity
- TimeZone
- DateObject
- AbsoluteTime
- DateList
- DateString
-
- Entity Types
- TimeZone
-
- Interpreter Types
- TimeZone
- Related Guides
- Tech Notes
-
-
See Also
- $SystemTimeZone
- $TimeZoneEntity
- TimeZone
- DateObject
- AbsoluteTime
- DateList
- DateString
-
- Entity Types
- TimeZone
-
- Interpreter Types
- TimeZone
- Related Guides
- Tech Notes
-
See Also
gives the current time zone to assume for dates and times.
$TimeZone
gives the current time zone to assume for dates and times.
Details
- $TimeZone gives the default time zone used by date functions.
- Possible timezone specifications include:
-
n number of hours added to GMT "zone" named time zone Entity["TimeZone", "zone"] time zone specified by the "TimeZone" entity loc time zone associated with the given location Automatic automatically determine the time zone None specify no time zone information - For numeric values n, the value represents the number of hours that must be added to Greenwich Mean Time (GMT) to obtain local time.
- For string specifications "zone", the result will be returned in the associated named time zone.
- Example time zone strings include "America/Chicago", "Europe/London", "Asia/Tokyo" and "Zulu".
- A list of available time zone entities can be found using EntityList["TimeZone"].
- For location specifications loc, the time zone associated with the specified location Entity or GeoPosition will be used.
- $TimeZone defaults to $SystemTimeZone.
- $TimeZone=z resets the current time zone for purposes of functions like DateString, DateList, and AbsoluteTime.
Examples
open all close allBasic Examples (3)
Show the number of hours that must be added to GMT to obtain local time:
$TimeZoneConvert a DateObject from a different time zone to $TimeZone:
TimeZoneConvert[DateObject[{2026, 6, 4, 21, 15, 46.505509}, "Instant", "Gregorian", "Africa/Lagos"], $TimeZone]Find the TimeZoneOffset between $TimeZone and Berlin:
TimeZoneOffset[$TimeZone, Entity["City", {"Berlin", "Berlin", "Germany"}]]Scope (2)
If $TimeZone may be set to a real-valued number, a "TimeZone" Entity or a named time zone string:
$TimeZone = 3;
DateObject[]$TimeZone = Entity["TimeZone", "Asia/Shanghai"];
DateObject[]$TimeZone = "America/Lima";
DateObject[]$TimeZone may also be set to a GeoPosition or location Entity, which will return the corresponding time zone for the location:
$TimeZone = Entity["City", {"Tokyo", "Tokyo", "Japan"}];$TimeZone$TimeZone = GeoPosition[{0, 0}];
$TimeZoneProperties & Relations (3)
The value of $TimeZone is initialized to $SystemTimeZone when the kernel launches:
$TimeZone == $SystemTimeZone$TimeZone can have its value reset or blocked:
$TimeZone = "America/Chicago"DateObject[]Block[{$TimeZone = 0}, Now]Most date functions have a default TimeZone value of Automatic, which implies $TimeZone if no other information is available:
Options[DateObject, TimeZone]Possible Issues (1)
If $TimeZone is set to a GeoPosition and internet access is not available, the value of $TimeZone will not be changed:
$TimeZone
Block[{$AllowInternet = False}, $TimeZone = GeoPosition[Entity["City", {"Paris", "IleDeFrance", "France"}]]];
$TimeZoneSee Also
$SystemTimeZone $TimeZoneEntity TimeZone DateObject AbsoluteTime DateList DateString
Entity Types: TimeZone
Interpreter Types: TimeZone
Tech Notes
History
Introduced in 2007 (6.0) | Updated in 2014 (10.0) ▪ 2022 (13.1)
Text
Wolfram Research (2007), $TimeZone, Wolfram Language function, https://reference.wolfram.com/language/ref/$TimeZone.html (updated 2022).
CMS
Wolfram Language. 2007. "$TimeZone." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/$TimeZone.html.
APA
Wolfram Language. (2007). $TimeZone. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$TimeZone.html
BibTeX
@misc{reference.wolfram_2026_$timezone, author="Wolfram Research", title="{$TimeZone}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/$TimeZone.html}", note=[Accessed: 16-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_$timezone, organization={Wolfram Research}, title={$TimeZone}, year={2022}, url={https://reference.wolfram.com/language/ref/$TimeZone.html}, note=[Accessed: 16-June-2026]}