The timeZone
classes represent time zones.
timeZone
is a virtual class and has no slots.
(character
) the name of a built-in time zone.
(integer
) the offset from GMT (in seconds) when not on daylight savings time.
(data.frame
) rules encoding when to go on daylight savings time (see below).
The splusTimeDate package contains built-in time zones for the 24 standard time zones around the world. We also include daylight savings time in various areas, and standard time for Central Australia, which is 1/2 hour off Eastern Australia. Currently, the correct daylight savings areas provided are:
US (1967 and beyond).
Canada (1974 and beyond).
New Zealand (1976 and beyond).
Australia (1973 and beyond).
Great Britain (1972 and beyond).
European Union (1977 and beyond).
Hong Kong (1970 and beyond).
Also, we provide a special time zone for Singapore, which was 7:30 ahead of GMT until May of 1982, when it changed over to 8:00.
The official names of the time zones, in order around the world, are shown below along with their offset from Universal Coordinated Time (UTC, also known as GMT).
Standard time for New Zealand, UTC East 12 hours.
Standard/summer time for New Zealand.
Standard time for Caroline, UTC East 11 hours.
Standard time for Eastern Australia, UTC East 10 hours.
Standard/summer time for New South Wales, Australia.
Standard/summer time for Tasmania, Australia.
Standard/summer time for Victoria, Australia.
Standard time for Central Australia, UTC East 9:30 hours.
Standard/summer time for South Australia.
Standard time for Japan, UTC East 9 hours.
Standard time for China, UTC East 8 hours.
Standard/summer time for Western Australia.
Standard/summer time for Hong Kong.
Standard time for Singapore, reflecting changed zones in 1982.
Standard time for Saigon, UTC East 7 hours.
Standard time for Kazakh area, UTC East 6 hours.
Standard time for Pakistan, UTC East 5 hours.
Standard time for Caspian Sea area, UTC East 4 hours.
Standard time for Moscow, UCT East 3 hours.
Standard time in Eastern European zone, UTC East 2 hours.
Standard/summer time for EU members, Eastern zone.
Standard time in Central European zone, UTC East 1 hour.
Standard/summer time for EU members, Central zone.
UTC (also known as GMT).
Standard/summer time for Great Britain,
Standard/summer time for EU members, Western zone,
Standard time for Azores, UTC West 1 hour.
Standard time for Oscar, UTC West 2 hours.
Standard time for Western Greenland, UTC West 3 hours.
Standard/daylight time for Newfoundland, Canada.
Standard time for Atlantic time zone, UTC West 4 hours.
Standard/daylight Canadian Atlantic time.
Standard time for Eastern time zone, UTC West 5 hours.
Standard/daylight US Eastern time.
Standard/daylight Canadian Eastern time.
Standard time for Central time zone, UTC West 6 hours.
Standard/daylight US Central time.
Standard/daylight Canadian Central time.
Standard time for Mountain time zone, UTC West 7 hours.
Standard/daylight US Mountain time.
Standard/daylight Canadian Mountain time .
Standard time for Pacific time zone, UTC West 8 hours.
Standard/daylight US Pacific time.
Standard/daylight Canadian Pacific time .
Standard time for Alaska/Yukon time, UTC West 9 hours.
Standard/daylight US Alaska time.
Standard/daylight Canadian Yukon time.
Standard time for Hawaii/Alleutian, UTC West 10 hours.
Standard/daylight US Hawaii/Alleutian time.
Standard time for Samoa, UTC West 11 hours.
You can use the time zones listed in Built-In Zones for various operations
on timeDate
objects, including reading times from character data,
writing times as character data, and converting between time zones.
However, normally the names listed in the table are not used directly,
because users want to use the names commonly used in their
areas, such as CST for Central Standard Time in the US, Canada, or
Australia. The correspondence between "convenient" and "official" names
is set up using the timeZoneList
function.
Besides using the time zones listed in Built-In Zones, users can also define
their own time zones through use of the timeZoneR
class. This
class allows specification of a time zone with an offset from GMT,
in seconds, in the offset
slot, and a data frame containing rules
for when and how to go on daylight savings time in the rules
slot.
(If there is no daylight savings time in this time zone, the data frame
should be empty or have 0 rows.)
Each row in the rules data frame encodes a range of years' daylight savings rules; they must be in order to work properly. The rules are encoded in the following columns of the data frame (which must be in order, and all of class integer):
yearfrom | starting year for rules, or -1 to start at the beginning of time. |
yearto | ending year for rules, or -1 to end at the end of time. |
hasdaylight | indicates whether daylight savings time is used in this year range. Note that this is an integer value, 1 or 0, for true or false. |
dsextra | offset (in seconds) to add to the regular offset when daylight time is in effect. |
monthstart | month (1-12) in which daylight savings time starts (may be before
monthend for southern hemisphere). |
codestart | code telling how to interpret daystart
and xdaystart to calculate the day
within the month for starting daylight savings time. |
1 = start on the daystart (1-31) day of the month. | |
2 = start on the last daystart (0-Sunday through 6-Saturday) weekday
in the month. | |
3 = start on the first daystart weekday (0-Sunday through 6-Saturday)
on or after the xdaystart (1-31) day of the month. | |
4 = start on the last daystart weekday (0-Sunday through 6-Saturday)
on or before the xdaystart (1-31) day of the month. | |
daystart | see codestart . |
xdaystart | see codestart . |
timestart | seconds after midnight local standard time to start daylight savings time,
on the day specified by codestart , and so on. |
monthend | month (1-12) in which daylight savings time ends (may be after
monthstart for southern hemisphere). |
codeend | code telling how to interpret dayend
and xdayend to calculate the day within the month
for ending daylight savings time. |
1 = end on the dayend (1-31) day of the month. | |
2 = end on the last dayend (0-Sunday through 6-Saturday) weekday
in the month. | |
3 = end on the first dayend weekday (0-Sunday through 6-Saturday)
on or after the xdayend (1-31) day of the month. | |
4 = end on the last dayend weekday (0-Sunday through 6-Saturday)
on or before the xdayend (1-31) day of the month. | |
dayend | see codeend . |
xdayend | see codeend . For examples, see the timeZoneR function. To use user-defined time
zones, you must put them in the time zone list (see timeZoneList function). |
timeend | seconds after midnight local standard time to end daylight savings time,
on the day specified by codeend , etc. |
The timeZone
class is a virtual class for time zones. All
time zones classes have an is
relationship with timeZone
.
The timeZoneC
class is a placeholder for a built-in time
zone, and it has only one slot, which is the official name of the zone;
it extends timeZone
.
The timeZoneR
class is for user-defined time zones, and also extends
timeZone
.
Daylight savings boundaries and other time zone information are from the Time Zone Database (often called tz or zoneinfo). See: https://www.iana.org/time-zones.
timeZoneC
function, timeZoneR
function, timeZoneList
function.