03-22-2016 07:44 AM - edited 03-22-2016 07:46 AM
Hi,
I have done a code to store date in a .txt file and then read from that txt file and output that date into a time stamp indicator. But the problem the input time and output time are not same. I dont know why. I have uploaded the code. Thanking You in advance.
03-22-2016 07:55 AM
Your problem is that you use "%T" in your format string. %T is absolute time which actually has the time first and then the date.
You need to change that to use the correct time format that matches the way you save time. I got your VI working when I replaced "%T" with "%<%m/%d/%y %I:%M:%S %p>T". Look up the format codes for time format string for more details on what each part means.
03-22-2016 08:00 AM
Could you please upload the working VI, which you got.
03-22-2016 08:05 AM
03-22-2016 08:11 AM
pulidotech wrote: I got your VI working when I replaced "%T" with "%<%m/%d/%y %I:%M:%S %p>T".
The Format Date/Time String defaults to "%c". Therefore the Scan From String should have the format of "%<%c>T" to match.
However, %c uses the system format. This is generally a bad idea. If I tried to read the same string on my machine, it would fail. So the format should be explicit on the Format Date/Time String and the Scan From String to make it consistant on all systems.
03-22-2016 09:16 AM - edited 03-22-2016 09:18 AM
Thank You very much. I got it. I got it using %<%c>T. So when u said the format should be explicit on the Format Date/Time String and the Scan From String to make it consistant on all systems, I didnt understand. What does it mean.Which format should I use. Thanking You.
03-22-2016 09:23 AM
What he's referring is that when your formats should be explicit in both the write and read steps. Look at the image for an example on a consistent/explicit %c format.
03-22-2016 09:39 AM
Thank u got it
03-22-2016 09:45 AM - edited 03-22-2016 09:46 AM
@pulidotech wrote:What he's referring is that when your formats should be explicit in both the write and read steps.
Actually, I meant something more like this