Configuring Daylight Saving Time Settings
- Updated2023-02-21
- 2 minute(s) read
Configuring Daylight Saving Time Settings
gmtime, localtime, and mktime make corrections for daylight saving time (DST). LabWindows/CVI uses the operating system time zone information to determine time zone and daylight saving settings.
You can modify daylight saving time settings by including a DST rules string in the LabWindows/CVI configuration options in the registry.
DST Rules String Description
In general, a DST rules string contains one or more rules, each beginning with a colon followed by a year in parentheses. The year indicates the first year to which the rule applies. You must put the rules for the more recent years first.
The following line is an example of a DST rules string that contains three rules:
":(2007)030802+0:110102+0:(1987)040102+0:110102-0:(1967)040102-0:110102-0"
- The first rule (:(2007)030802+0:110102+0) applies to years 2007 and later.
- The second rule (:(1987)040102+0:110102-0) applies to years 1987 to 2006.
- The third rule (:(1967)040102-0:110102-0) applies to years 1967 to 1986.
Each rule consists of a set of descriptors that indicates when to switch between standard and daylight saving time. Each descriptor follows the format MMDDHH+/-Wd.
- MM identifies a month, where 01 indicates January.
- DD indicates the day of the month.
The month and day together serve as a reference point for the latter portion of the descriptor. - Wd is a day of the week, with 0 indicating Sunday, 1 indicating Monday, and so on.
- The minus sign (-) or plus sign (+) indicates whether the day of the week is the one before (-) or after (+) the month and day the MMDD portion describes. Thus, 040102+0 indicates the first Sunday in April, and 110102-0 indicates the last Sunday in October.
- HH indicates the hour of the day.
The example string specifies the following:
Rule | Description |
:(2007)030802+0:110102+0 | From 2007 to the present, DST begins at 2 AM on the second Sunday in April and ends at 2 AM on the first Sunday in November. |
:(1987)040102+0:110102-0 | From 1987 to 2006, DST begins at 2 AM on the first Sunday in April and ends at 2 AM on the last Sunday in October. |
:(1967)040102-0:110102-0 | from 1967 to 1986, DST begins at 2 AM on the last Sunday in March and ends at 2 AM on the last Sunday in October. |