12-12-2014 11:10 AM
Hello
I need to convert a Unix timestamp comming froma dll to a LabVIEW time. Does anybody now some ready to use function for this?
Thanks
Solved! Go to Solution.
12-12-2014 11:29 AM - edited 12-12-2014 11:38 AM
What is the datatype of the unix timestamp?
The epoch of unix is 1/1/1970.
The epoch of LabVIEW is 1/1/1904
All you need to add is the number of seconds between the two epochs (i.e. the value of a LabVIEW timestamp of 1/1/1970)
12-14-2014 04:07 AM
Oh yes. That was easy.
Thank you very much!
12-15-2014 10:29 AM - edited 12-15-2014 10:33 AM
@DAckermann wrote:
Oh yes. That was easy.
Thank you very much!
Exceot that there is a small possible gotcha. If you enter 1/1/1970 in a LabVIEW timestamp control and convert this to a double to get the number of seconds you likely end up with an error of your local timezone offset.
Both the Unix and LabVIEW epoch are defined respective to GMT which for most practical purposes is the same as UTC. So you have to make sure to get the number of seconds for a timestamp that shows 1/1/1970 00:00 UTC to be right.
06-27-2024 06:00 AM
I cannot express how much this little hint means to me. Thank you so much!
Here is a screenshot of a TimeStamp Constant, where I changed the Display Format to show UTC and then the magical 1h appeared. It haunted me for days, that my data appeared to be in the future in my database, when I was sending the Time as a UNIX Timestamp.