LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Format Date/Time string does not return the correct time on RT

Format Date/Time string does not return the correct time, %I:%M %p

Time is correct on input but adds 5 hours consistently to output. 11:01 PM => 04:01 AM

Tried UTC both T&F no change.

Code works on PC but not when deployed on RT I run the Get Date/Time String function on the RT and time appears the same as my PC.

My purpose is to perform a daily file deletion, so I check to see if deletion time equals current time. If so then perform data deletion.



0 Kudos
Message 1 of 5
(3,849 Views)
Did you set the time zone on the RT target correctly via MAX?
0 Kudos
Message 2 of 5
(3,838 Views)
I was unaware that you could set this in MAX. I thought you had to use an RT Set Date and Time function.
0 Kudos
Message 3 of 5
(3,837 Views)
The RT target has it's own time zone, obviously it can be different from the host time zone. RT set date and time has a mode input:

mode
sets the date, sets the time to local time set on the device, or sets the time to UTC time.
0 Set the date of the device.
1 Set the time of the device to the local time.
2 Set the time of the device to the UTC time.


Depending on the time zone of the RT device and the mode you use you'll end up with an offset.

0 Kudos
Message 4 of 5
(3,832 Views)

Hi Aaron,

dan_u is correct; the issue is most likely that you have the incorrect time zone set on your RT Target.  To change the time zone setting, open Measurement and Automation Explorer, under Remote Systems select your RT target.  Then, choose the System Settings tab.  Here, you can change the time zone.  Please take a look at the following image for more information.


If you have any further questions, please do not hesitate to let me know by replying to this post.  Best of luck on your application, and have a great day!!

Message Edited by cphuong on 04-12-2007 08:11 AM

Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
0 Kudos
Message 5 of 5
(3,813 Views)