Time zone specification.
Syntax: @tzspec(str)
str: string
Return: string
Returns time zone information for the first time zone whose description contains the piece of text passed in as str.
tr can be a city name such as “London” or “Tokyo” or any other word from the time zone description such as “Eastern” for the U.S. Eastern Time Zone.
Time zone information specifications have the format:
standard_utc_bias [daylight_offset daylight_start_rule daylight_end_rule]
where:
• standard_utc_bias is the offset (in +/– hh:mi format) of local time from UTC when daylight time is not in effect.
• daylight_offset is the additional adjustment (in +/– hi:mi format) to the standard UTC bias when daylight time is in effect.
• daylight_start_rule is the day/time when the daylight time adjustment begins. This can be an explicit date or a date rule.
• daylight_end_rule is the day/time when the daylight time adjustment ends. This can be an explicit date or a date rule.
If there have been historical changes to the time zone rule, each era is returned beginning with an “@” symbol followed by the year in which the new rule took effect. The year may be dropped to indicate that the rule should be applied to all earlier dates.
For example, a historical description of the Pacific Time Zone (PT) description for parts of western Canada, the western United States, and western Mexico (valid from 1987 onwards) has the specification:
@2007 -08:00 +01:00 Mar2Sun 2AM to Nov1Sun 2AM
@ -08:00 +01:00 Apr1Sun 2AM to Oct-1Sun 2AM
The standard offset of the Pacific Time Zone from UTC is -8 hours. The daylight rule after 2007 has been to move clocks forward by one hour at 2AM on the second Sunday of March and move them back at 2AM on the first Sunday in November. Before 2007 the rule was to move clocks forward by one hour at 2AM on the first Sunday of April, and move them back at 2AM on the last Sunday in October.
Examples
The command
string london_spec = @tzspec("London")
assigns a text description of the London time zone specification (Greenwich Mean Time (GMT) during standard time and British Summer Time (BST) during Daylight Saving Time (DST)),
+00:00 +01:00 Mar-1Sun 1:00 to Oct-1Sun 2:00
to the string object LONDON_SPEC, while
string eastern_spec = @tzspec("Eastern")
assigns the U.S. Eastern Time Zone (ET) description
@2007 -05:00 +01:00 Mar2Sun 2:00 to Nov1Sun 2:00 @ -05:00 +01:00 Apr1Sun 2:00 to Oct-1Sun 2:00
to the string object EASTERN_SPEC.
If ALPHA1 is an alpha series, the command
alpha a1 = @tzspec(alpha1)
fills A1 with time-zone specifications associated with the spec in ALPHA1, for each observation in the workfile sample.
If AVEC1 is an svector, the commands
svector s1 = @tzspec(avec1)
creates a vector of time-zone specifications corresponding to elements of AVEC1.
Cross-references
See
“Dates” and
“Event Functions” for related discussion.
See also the related time zone functions
@utc,
@localt,
@tz, and
@tzlist.