09-21-2017 05:40 PM
Hello.
I'm attempting to understand the logical algorithm Labview uses to convert relative time to dbl. I know that absolute time is converted by the number of seconds elapsed passed epoch - is relative time the number of seconds, or miliseconds, or something else?
I'm attempting to control the visible time period on a waveform chart, so I want to make sure I understand how Labview handles timestamps.
Solved! Go to Solution.
09-22-2017 01:36 AM - edited 09-22-2017 01:39 AM
09-22-2017 06:32 AM
The absolute times that are shown (in a timestamps and doubles configured as absolute time) are just visualisations of seconds since epoch (1-1-1904 UTC). A timestamp value (e.g. constant) will display a different time on PC's configured with different time zones and\or different daytime correction options.
So you'll have your seconds since epoch, and the way this is displayed as date\time "string". The displayed string is "flexible", the value is fixed. The confusing part is that the way "absolute time" shown is not fixed (as it depends on target PC). Unless you set it to UTC.
If you convert to double, you'll always get the seconds since epoch. However, if you convert 6-6-2006 00:00:00 to timestamp, the seconds since epoch is only the same if you specify it's UTC. If you don't, the timestamp will show the correct date\time (e.g. 6-6-2006 00:00:00), but the seconds since epoch can be different.
It's not easy...
09-22-2017 07:50 AM
wiebe@CARYA wrote:
The absolute times that are shown (in a timestamps and doubles configured as absolute time) are just visualisations of seconds since epoch (1-1-1904 UTC).
Minor modification to Wiebe's note -- Timestamps represent the difference between a date/time and the Epoch, and can be positive (if after 1 Jan 1904 UTC) or negative (e.g. 1 Jan 1900). I vaguely recall trying to see "how far back" I could go -- as I recall, it was at least a few centuries, but less than a millenium ...
Bob Schor
09-22-2017 08:00 AM
@Bob_Schor wrote:
wiebe@CARYA wrote:
The absolute times that are shown (in a timestamps and doubles configured as absolute time) are just visualisations of seconds since epoch (1-1-1904 UTC).
Minor modification to Wiebe's note -- Timestamps represent the difference between a date/time and the Epoch, and can be positive (if after 1 Jan 1904 UTC) or negative (e.g. 1 Jan 1900). I vaguely recall trying to see "how far back" I could go -- as I recall, it was at least a few centuries, but less than a millenium ...
Bob Schor
The timestamps themselves can go very far, it's just the conversion to string (the visualisation) is limited (to max 3000, don't know the min.). Adding 8000 year to current and then subtracting 7000 years is no problem. But the intermediate result (current+8000) will display as the year 3000 (basically "overflow").
11-07-2017 07:42 AM
To submit an answer to my own question:
The simply algorithm of relative and absolute time is, in fact, rather easy to understand. The strange part is how charts display it, and how you set increments on a chart.
If the chart is set to display time to the second, then the value you enter into the properties window of the chart will be evaluated as time in seconds. (example: if the first value of the chat is a value of 20, and the chart is set to seconds, relative time, then the first value of the chart will be 20 seconds, relative time. If the chart is set to display milliseconds, then the 20 is evaluated as 20 milli seconds).
My question ended up being less about relative and absolute time in Labview, and more about how Labview charts evaluate numerical values into relative and absolute timestamps
11-07-2017 07:44 AM
@Bob_Schor wrote:
wiebe@CARYA wrote:
The absolute times that are shown (in a timestamps and doubles configured as absolute time) are just visualisations of seconds since epoch (1-1-1904 UTC).
Minor modification to Wiebe's note -- Timestamps represent the difference between a date/time and the Epoch, and can be positive (if after 1 Jan 1904 UTC) or negative (e.g. 1 Jan 1900). I vaguely recall trying to see "how far back" I could go -- as I recall, it was at least a few centuries, but less than a millenium ...
Bob Schor
I never knew this. Very interesting, thank you!