timeZone
classes represent time zones in S.
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
timeZone
class is a virtual class for time zones in S-PLUS. All
time zones classes have an
is
relationship with
timeZone
.
The
timeZoneC
class is basically 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
timeZoneS
class is for user-defined time zones, and also extends
timeZone
.
S-PLUS 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 of 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), and Hong Kong (1970 and beyond). We also 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).
The time zones listed above can be used in 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 will not be used directly,
because users will want to use the names commonly in use in their
area, 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 built-in time zones above, users can also define
their own time zones through use of the
timeZoneS
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):
monthend
for southern hemisphere).
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.
codestart
.
codestart
.
codestart
, etc.
monthstart
for southern hemisphere).
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.
codeend
.
codeend
.
For examples, see the
timeZoneS
function. To use user-defined time
zones, you must put them in the time zone list (see
timeZoneList
function).
codeend
, etc.
Daylight savings boundaries and other time zone information was taken from the public-domain time zone library from the ftp://elsie.nci.nih.gov/pub/ ftp site.