When you are creating aggregate reports, time series data is stored in an asset's time zone. What if that is not the time zone you need? You find yourself in one of these situations:
Solution
Even though the time zone of assets cannot be changed after creation, you still can see aggregate data for the time zone needed. You can generate this specific data by calculating the time zone offset when using the IoT Time Series Aggregates Service v3 APIs.
For example, lets say your asset is in the Eastern time zone. That is UTC -04:00. To query day aggregates, the hour should be 20:00 like in this base URL:
/api/iottsaggregates/v3/aggregates/{assetId}/{aspectName}?from=2020-01-10T20:00:00 Z&to=2020-01-12T20:00:00 Z&intervalUnit=day&intervalValue=1
You can also specify the time zone this way:
/api/iottsaggregates/v3/aggregates/{assetId}/{aspectName}?from=2020-01-11T00:00:00-04 :00&to=2020-01-13T00:00:00-04 :00&intervalUnit=day&intervalValue=1
Querying with Daylight Saving Time (DST) is done in the same manner. Whether you specify the time based on UTC hours, the one thing to note is when setting the time zone of the time range, the '+' character must be encoded to '%2B' in the URL. For example, 2020-10-01T00:08:00%2B 02:00 instead of 20207-10-01T00:08:00+02:00.
To learn more about defining start times and time ranges, visit:
https://developer.mindsphere.io/apis/iot-iottsaggregates/api-iottsaggregates-samples.html
Notes