Managing Time Zones and Local Time: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
When importing data to QPR ProcessAnalyzer, date and time data in different local times may be encountered. It's important that the times are interpreted correctly, so that they are comparable and for example durations between timestamps are calculated correctly. | When importing data to QPR ProcessAnalyzer, date and time data in different local times may be encountered. It's important that the times are interpreted correctly, so that they are comparable and for example durations between timestamps are calculated correctly. QPR ProcessAnalyzer doesn't store the time zone information, but instead records timestamps exactly as they have been imported to it. The models can thus contain timestamps from any time zones and it's just a matter of agreement, which time zone the timestamps represent. | ||
QPR ProcessAnalyzer doesn't store the time zone | |||
When importing data with [[Importing_Data_to_Datatable_from_CSV_File|CSV file import]], there is a difference whether timestamps in CSV files have the time zone information. If timestamps don't have the time zone, times are interpreted as such and they appear in the model exactly as imported. If the timestamps have the time zone information, timestamps are imported as UTC, to make timestamps with different time zones comparable with each other. It's also possible to import timestamps without the time zone in the date format (i.e. no "zzz") which will ignore the time zone and import timestamps like they didn't have the time zone information. | When importing data with [[Importing_Data_to_Datatable_from_CSV_File|CSV file import]], there is a difference whether timestamps in CSV files have the time zone information. If timestamps don't have the time zone, times are interpreted as such and they appear in the model exactly as imported. If the timestamps have the time zone information, timestamps are imported as UTC, to make timestamps with different time zones comparable with each other. It's also possible to import timestamps without the time zone in the date format (i.e. no "zzz") which will ignore the time zone and import timestamps like they didn't have the time zone information. |
Latest revision as of 00:15, 17 November 2021
When importing data to QPR ProcessAnalyzer, date and time data in different local times may be encountered. It's important that the times are interpreted correctly, so that they are comparable and for example durations between timestamps are calculated correctly. QPR ProcessAnalyzer doesn't store the time zone information, but instead records timestamps exactly as they have been imported to it. The models can thus contain timestamps from any time zones and it's just a matter of agreement, which time zone the timestamps represent.
When importing data with CSV file import, there is a difference whether timestamps in CSV files have the time zone information. If timestamps don't have the time zone, times are interpreted as such and they appear in the model exactly as imported. If the timestamps have the time zone information, timestamps are imported as UTC, to make timestamps with different time zones comparable with each other. It's also possible to import timestamps without the time zone in the date format (i.e. no "zzz") which will ignore the time zone and import timestamps like they didn't have the time zone information.
As a recommended practice, if all time information in the source data is in a specific local time, timestamps can be imported in that time zone to QPR ProcessAnalyzer. If there are data where events shown with different time zones, it may be better to import timestamps as UTC to avoid any misinterpretation (this is done by including the time zone to the date format in the data import). If desired, timestamps may be converted into a different time zone using a script.
Example 1: CSV file contains the following data:
2021-05-16 08:34:12
When this value is imported to a datatable using date format yyyy-MM-dd HH:mm:ss, it is shown everywhere exactly as it was imported, i.e. 16th of May 2021 at 8:34:12.
Eaxmple 2: CSV file contains the following data:
2021-05-16 08:34:12+02:00
When this value is imported to a datatable using date format yyyy-MM-dd HH:mm:sszzz, it is imported as UTC, i.e. 16th of May 2021 at 6:34:12. If the CSV file is imported without the time zone in the date format (i.e. yyyy-MM-dd HH:mm:ss), the time zone is ignored and this timestamp is imported as 16th of May 2021 at 8:34:12.