Time zone (wwTimeZone)
- Last UpdatedJul 18, 2024
- 2 minute read
For Historian version 8.0 and later, all history data is stored in Coordinated Universal Time (UTC). The wwTimeZone extension allows you to specify the time zone to be used for the timestamps of the returned data values. The retrieval subsystem will convert the timestamps to local time in the specified time zone.
The wwTimeZone extension may be assigned any of the values stored in the TimeZone column of the TimeZone table in the Runtime database. In addition to specifying the name of the timezone in the wwTimeZone parameter, you can also specify the TimeZoneID (as a string). For example, on a typical US English system, specifying " wwTimeZone = 'Mountain Standard Time' " and " wwTimeZone = '64'" yields the same result.
The TimeZone table is repopulated at every system startup from Microsoft operating system registry entries, and will therefore reflect the time zones available from the server operating system, including any new or custom time zones which might be added by operating system service packs or installed software.
The retrieval subsystem will automatically correct for daylight savings time in the requested time zone. When computing daylight savings and time zone parameters, the settings of the server operating system are used. The retrieval sub-system does not provide any means for using client-side settings.
If wwTimeZone is not specified, the time zone for retrieval defaults to the time zone of the Historian computer.
For example:
SELECT TagName, DateTime, Value, wwTimeZone
FROM History
WHERE TagName IN ('SysTimeHour', 'SysTimeMin')
AND DateTime >= '2001-12-20 0:00'
AND DateTime <= '2001-12-20 0:05'
AND wwRetrievalMode = 'Delta'
AND wwTimeZone = 'W. Europe Standard Time'
The results are:
|
TagName |
DateTime |
Value |
wwTimeZone |
|---|---|---|---|
|
SysTimeMin |
2001-12-20 00:00:00.000 |
0 |
W. Europe Standard Time |
|
SysTimeHour |
2001-12-20 00:00:00.000 |
15 |
W. Europe Standard Time |
|
SysTimeMin |
2001-12-20 00:01:00.000 |
1 |
W. Europe Standard Time |
|
SysTimeMin |
2001-12-20 00:02:00.000 |
2 |
W. Europe Standard Time |
|
SysTimeMin |
2001-12-20 00:03:00.000 |
3 |
W. Europe Standard Time |
|
SysTimeMin |
2001-12-20 00:04:00.000 |
4 |
W. Europe Standard Time |
|
SysTimeMin |
2001-12-20 00:05:00.000 |
5 |
W. Europe Standard Time |
If you are using date/time functions and the wwTimeZone parameter, you will need to use the faaTZgetdate() function.