Time Zone (Core Services)
- Last UpdatedJun 15, 2023
- 2 minute read
- PI System
- PI Web API Reference
- Developer
The time zone can be specified for endpoints with a time (e.g. start time and end time) parameter. The specified time zone context will be used to interpret the time string when possible (e.g. for relative PI time strings such as "y" and "t"). The following behavior is to be expected:
-
If the time string already has a time zone offset designated in ISO 8601 format
(e.g. "2016-07-07T05:00:00Z" or "2016-07-07T05:00:55+02:00"), the time zone parameter is ignored
unless the time range crosses a daylight savings time boundary and an interval is specified. Example detailed below.
- (streams/interpolated) start time=2020-03-07T12:00:00-02:00, end time=2020-03-09T12:00:00-02:00, interval=1d, timezone=UTC
- If a daylight savings time boundary falls within the time zone offset start time or end time and there is an interval specified, then the time zone parameter will be honored.
- In this example, because the two timestamps contain the daylight savings time boundary(March 8th), the returned interpolated timestamps will utilize the time zone UTC specified
Timezone's effect on daylight savings time ranges with intervals
To setup this example the Stream controller's Interpolated endpoint will use the following values:
-
A start time of "2020-03-07T12:00:00-02:00"
-
An end time of "2020-03-09T12:00:00-02:00"
-
An interval of "1d"
No timezone
When no time zone is specified, the timestamps are shifted by one hour after the daylight
savings time boundary is passed to account for the time shift. The result has the timestamps
{ "2020-03-07T14:00:00Z", "2020-03-08T13:00:00Z", "2020-03-09T13:00:00Z" }.
The crossover happens on March 8th so we see here that the times are shifted subsequently.
Timezone is UTC
When time zone is specified, the timestamps will be
{ "2020-03-07T14:00:00Z", "2020-03-08T14:00:00Z", "2020-03-09T14:00:00Z" }.
As seen, the time zone parameter will apply to each timestamp in the interval
and will each honor the UTC parameter.
Notes about Daylight Savings Setting
-
If daylight saving time is enabled on the PI Web API server machine (when applicable):
- The operating system on which PI Web API instance is installed will dictate the daylight saving time rule for all time zones.
-
If daylight saving time is disabled on the PI Web API server machine (when applicable):
- If no time zone information is specified, the local time on the PI Web API instance is used and no daylight saving time is observed.
- If the time zone parameter is specified, daylight saving time is observed for all regions that support daylight saving time. This is true even if the time zone specified is identical to the local time zone for the PI Web API server.
Accepted Time Zone Formats
-
Windows Time Zone IDs. For example,
- Eastern Standard Time
- Pacific Standard Time
The full list of supported Windows time zone ids on this PI Web API instance can be found here.
-
IANA Time Zone Database (or Olson Database) IDs. For example,
- America/New_York
- Europe/Paris
The full list of supported IANA time zone ids on this PI Web API instance can be found here.