LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do timestamp conversion

The timestamp value from Get Date/Time in seconds gives
the current time. I want to convert this timestamp to string. But there is no ready made function to convert timestamp data type to string.
Also how to compare timestamp data type with string timestamp. Because i want to read the time stamp from file and compare with current timestamp.
Please help, Thanks
0 Kudos
Message 1 of 3
(3,209 Views)
> I want to convert this timestamp to string.

Use Format Date/Time String.

> Also how to compare timestamp data type with string > timestamp. Because i want to read the time stamp
> from file and compare with current timestamp.

Why can't you save the time stamp value instead of the text? That would be much easier.
0 Kudos
Message 2 of 3
(3,209 Views)
I aggree with Lars. Converting the timestamp to a numeric DBL and saving the DBL would be another option.
If you must read time in as text, the following methods exists:
1) Use a Timestamp Property Node
2) Parse string into Hours, Minutes, Seconds, etc. and use Date/Time to Seconds.
The attached VI uses the first method.
Download All
Message 3 of 3
(3,209 Views)