Posted on behalf of customer:
We are currently using the PI Web API 2021 SP1, version 1.15.0.162. We're using it to develop a proprietary C++ software.
One of our customers has PI Servers all over the world and wants to see the time stamps in the time zone of the PI Server. I'm aware that the PI Data Archive always saves the time as UTC, and I'm also aware that the time zone of the PI Server (or, better said, the time zone of the computer containing the PI Data Archive) might not be the same as the time zone of the collected data, but that is usually the case, at least for our customer. Because of this, it makes sense for our customer to see the time in the time zone of the PI Server / PI Data Archive.
Currently, our C++ software uses std::chrono::zoned_time (part of C++20 - https://en.cppreference.com/w/cpp/chrono/zoned_time) to allow the user to change the time zone. That allows us to either let the user choose the "local time zone" of the computer (std::chrono::current_zone()), or let him/her choose from a list of time zones from the IANA time zone database (std::chrono::get_tzdb()). However, this also means that the user must know exactly in which time zone the data is collected (or, for our customer, where the server exists in the world) and choose the correct time zone. That's still a lot better than not being able to choose the time zone at all, but does not allow our customer to simply "use the time zone of the PI Server", as there's currently no possibility to query it using the PI Web API. It is possible to query the server time as UTC (by querying /piwebapi/system/status), but not the server's time zone.
However, I found out that it is possible to query the time zone of the PI Server / PI Data Archive when using the Asset Framework SDK instead of the PI Web API: https://docs.osisoft.com/bundle/af-sdk/page/html/P_OSIsoft_AF_PI_PIServer_ServerTimeZone.htm
So what we would need would be a way to query the IANA Time Zone of the PI Server. For some other people, it may also make sense if you additionally provided the Windows Time Zone, but we need the IANA time zones to be able to use it with std::chrono::zoned_time. Suggestion: both the IANA Time Zone and the Windows Time Zone of the PI Server (PI Data Archive) could be provided when querying /piwebapi/system/status.
So, to summarize:
1. We think it makes sense to only provide access to the UTC time when responding to REST requests, as the data is always only saved as UTC in the PI Data Archive.
2. Customers might, nevertheless, still want to see the time stamps in the time zone of the PI server, so we would need access to the IANA time zone of the PI Server. We would then add the time zones to the UTC time ourselves (by using std::chrono::zoned_time), so we don't expect the PI Web API to return the time stamps with a time zone, as they are not saved with a time zone in the PI Data Archive anyway.