Timezones
Opinum manages the ingestion and display of data from different timezones.
General principles
Opinum stores raw points in UTC only and aggregated points per day in two timezones: UTC and Site timezone, also known as timezone reporting. The time zone of the source should be the timezone in which the data of the source will be ingested. The timezone of the sites and the timezone of the sources is defined at their creation.
Ingestion according to source timezone
The timezone of the source has two uses:
- Convert the date of incoming points to UTC. The idea is that a site with a timezone UTC+x can process sources with different timezones and standardize these dates at the time of posting by displaying all the data in the site's timezone (reporting).
- Convert the date of the API outgoing points if no timezone is specified in the query (timeZoneId or useReportingTimezone)
The datapoints must actually be sent in the time zone of the source.
Important
If you change the timezone of an existing source, the new timezone will be used only for the new data ingested after the change of the timezone. The timezone of the data already ingested can't be changed.
Examples:
Let's take a source whose time zone is UTC + 1. At 6:30 a.m. the device sends a datapoint dated 5:30 a.m. UTC. When Data Hub processes it, since the source tells it that 05:30 is UTC +1, it stores the value of the point at 04:30 (UTC).
Let's take a source whose time zone is UTC. At 6:50 a.m. the device sends a datapoint dated 5:50 a.m. UTC. When Data Hub processes it, since the source tells it that 05:30 is UTC, it stores the value of the point at 05:50 a.m UTC.
Display according to site timezone
Datapoints are displayed in Data Hub according to the site timezone (for example in Dashboards).
Example:
Let's take a site whose time zone is UTC+2. Given this timezone, Data Hub knows that it must transform all the dates of the points (coming from its sources) from UTC to UTC+2. Let's say that the sources are UTC+1, and the datapoints are correctly sent in UTC+1 in Data Hub. The datapoints will be displayed in Data Hub in UTC+2.
Let's take a site whose time zone is UTC+1. Given this timezone, Data Hub knows that it must transform all the dates of the points (coming from its sources) from UTC to UTC+1. Let's say that the sources are UTC+1. You will have the impression that the display is in UTC, but this is not the case! The offset of 1 hour is due to the mismatch between the TZ used by the device (UTC) and the one declared in the source (UTC+1).
Important
If you change the timezone of an existing site, the data that is older than five years or further than 2 years ahead in the future will not be impacted. This means that the time zone will not be converted and the initial one will be kept when displaying these data.