Time conversion file format
- Last UpdatedOct 02, 2024
- 2 minute read
The time conversion file is an ASCII file containing a list of time-stamp/offset pairs. The time stamp and offset are separated with a comma. Lines beginning with #, and empty lines and white spaces are ignored.
The time stamp may be a local time string in PI time format; either a fixed time in the format or a reference time, such as or . Only one time-stamp format can be used in a given file. The first format encountered is assumed for all time stamps.
The offset is the number of seconds to add to the event time stamps. Sub-second precision of the time shift is not supported. The offset is applied to all events with time stamps greater than or equal to specified time stamp but less than next time stamp in the conversion file.
Example 1
The following example uses UTC seconds time format. The time stamp 0 is January 1, 1970, and the time stamp 2000000000 is well into the 21st century. The offset is a positive 3600 (one hour).
Therefore this data file will simply move all events ahead by one hour.
# Example 1, Moves entire archive ahead by 1 hour
0,3600
2000000000,3600
Example 2
Similar to the first example, this example uses local time stamps to specify a suitably large time range to cover all events. The offset is -3600. This data file will move all events back by one hour.
# Example 2, Also moves entire archive back by 1 hour
01-Jan-70 00:00:00,-3600
01-Jan-30 00:00:00,-3600
Example 3
This example applies a missed DST conversion for the Northern Hemisphere summer of 2003. The first time stamp is set at 01-Jan-03 to include all events up to the DST transition; no offset is applied up to, but not including 06-Apr-03 02:00:00. From 06-Apr-03 02:00:00 up to, but not including, 26-Oct-03 02:00:00 one hour is added to all events. No offset is applied from 26-Oct-03 02:00:00 to current time.
# Example 3, Applies a missed dst conversion to an
# archive that covers summer of 2003
01-Jan-03 00:00:00,0
06-Apr-03 02:00:00,3600
26-Oct-03 02:00:00,0
31-Dec-03 23:59:59,0