Scripting > UNICOM Intelligence Function Library > Date and time functions > GetTimeZoneDaylightSaving
 
GetTimeZoneDaylightSaving
Returns True if daylight saving is currently in effect at the specified time (or now) in the specified time zone (or the program's time zone).
Syntax
GetTimeZoneDaylightSaving([Val [, Time]])
Parameters
Val
Type: None
Optional. Long or Text value specifying time zone to use.
Time
Type: Date
Optional. Local date and time to use.
(return)
Type: Boolean
Whether daylight-saving is in effect at the specified time in the specified time zone.
Remarks
If Val is a Long value, it is the index value of a time zone defined in the registry on the server.
If Val is a Text value, it is the name of a time zone defined in the registry on the server.
If Val is omitted, NULL or empty, the time zone associated with the program in which the function is called is used. By default, the program's time zone is the local time zone of the server, but this can be changed by calling SetTimeZone.
If a time zone name is used, it is case-insensitive.
The special values of -1 and “UTC” can be used for the time zone; these do not correspond to anything in the registry, but instead refer to UTC time, with no offset or daylight saving defined.
If Val is any other type, an error occurs. If the time zone specified by Val cannot be found in the registry, an error occurs.
If Time is omitted, or equal to 30 December 1899, 00:00:00 (the date internally represented by the numeric value 0), then the current local date and time for the time zone are used.
For some time zones (for example, 275 “West Pacific Standard Time”) this function always returns False, because the time zone does not use daylight saving.
Example
This example returns True if daylight-saving is in effect for the current local date and time in the Central Standard Time time zone.
GetTimeZoneDaylightSaving("Central Standard Time")
See also
DateAdd
Date and time functions