LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Format Question

Hey guys,

I was wondering if there was a way to format the date and time from a supplied string.  I noticed that the date/time format function grabs the time directly from the PC.  I am receiving date/time stamps through the serial port every second.  I would like to format this string.  I am able to grab the time and synchronize it with the computer, but the date is given in the Julian format, which is the number of days since January 1.  I need to be able to format this date such that I can synchronize the date on the PC too.  Also, is there a command I can execute in the command prompt to set the PC's date.  For instance, I used "time 00:00:00" to set the PC's time.

Thanks,
Jared Lucey
0 Kudos
Message 1 of 3
(2,371 Views)

Look at tbob's example here for converting string to timestamp. You may need to do some calculations.

To set the date, surprisingly enough, you can use the "date" command in exactly the same way as the time command. Run it once in the command window to see the format (in my computer it's MM-DD-YY) and then just run it with the date.


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,360 Views)
Thanks tst, that looks exactly like what I was trying to do.
0 Kudos
Message 3 of 3
(2,353 Views)