IsDaylightSavings function
Syntax
IsDaylightSavings(datetime, {timezone | "Local" | "Base"})
Description
Use the IsDaylightSavings function to determine if daylight saving time is active in the specified time zone at the specified date and time. For time zones that don’t observe daylight saving time, this function always returns False.
The system’s base time zone is specified on the PSOPTIONS table.
Parameters
| Parameter | Description |
|---|---|
|
datetime |
The DateTime value you want to check. |
|
timezone | Local | Base |
Specify a value for converting datetime. The values are:
|
Returns
A Boolean value: True if daylight saving time is active in the specified time zone at the specified date and time. Returns False otherwise.
Example
In the first example, TESTDTTM has value of 01/01/99 10:00:00AM. &OUTPUT is False.
&OUTPUT = IsDaylightSavings(TESTDTTM, "EST")
In this example, TESTDTTM has value of 04/05/99 12:00:00AM. &OUTPUT has a value of True: 12:00am PST = 3:00am EST, so daylight saving time has switched on.
&OUTPUT = IsDaylightSavings(TESTDTTM, "EST")
In this example, TESTDTTM has value of 04/05/99 12:00:00AM. &OUTPUT returns False: 12:00am PST = 1:00am MST, so daylight saving time hasn't started yet.
&OUTPUT = IsDaylightSavings(TESTDTTM, "MST")
In this example, TESTDTTM has value of 07/07/99 10:00:00. &OUTPUT returns False: ESTA is Indiana time, where they do not observe daylight saving time.
&OUTPUT = IsDaylightSavings(TESTDTTM, "ESTA")