04-30-2015 03:36 AM - edited 04-30-2015 03:36 AM
Hey there,
I have a pretty peculiar problem. I'm working on two PCs right now, one is my private laptop running on Windows 8, and the other one the PC at my workplace, running on Windows XP, but on the same version of LabVIEW. I use this method to save the time and date to a tab delimited .txt file. Then later, with another VI, I read the date and time written to file to reconstruct the time stamp. I've noticed that dates written to file from my workplace differ from the dates written from my private PC: in Windows XP, there are "-" separating the day, month and year. In Windows 8, it's "/". There are other differences (see pictures). So naturally, when reading from file using my VI, I can only read on my private PC files (or at least dates) written on my private PC and vice versa, I can't read files written on my private PC on my workplace PC. Can anybody tell me why there's a difference in format, or how to write the date uniformly so I can read it on any PC, or how to read both formats?
So this is the method I use for writing the time and date (the subVI only inserts a certain number of TAB characters).
This is what it looks like on Windows 8
This is what it looks like on Windows XP
This is the VI (attached) I use to read the time stamps (the first row actually contains the time stamp in HH:MM: SS format for a whole bunch of measurements).
Have a nice day.
Solved! Go to Solution.
04-30-2015 04:26 AM
Hi Leykocyte,
two comments:
1. The difference in timestamp format is originated in the local PC "regional settings" regarding timestamp formats - set the same regional settings for all computers/accounts. And it is originated in your LabVIEW routine as you use the local timestamp format of the PC. Better solution to save formatted timestamps (atleast from programmer point of view): use a fixed timestamp format like %Y%m%d-%H%M%S…
2. When reading the timestamps you need to program some more checks. Reading the values could be done with a format string like "%d%1s%d%1s%d" (for the date part) - but don't forget to check for year values like "15" vs "2015"…
04-30-2015 11:49 AM
I would suggest using the ISO-8601 UTC format.
The only limitation is that the string value is in reference to GMT.
The conversion of the string back to a timestamp will present the date/time on your front panel indicator as local time.