From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Daylight Saving Format Data/Time String vs Get Date/Time in Seconds

Solved!
Go to solution

Dear all,

 

I have been developing a real time application by using a cRIO 9074 that has two loops. The first collects data and records time by using the "Format Date/Time String" module with the following time sting: "%d/%m/%Y %H:%M". The output is a sting with day/mouth/year hour:minute.

The second loop gets time from the cRIO by using the "Get Date/Time in Seconds" module and the timestamp output is sent by a shared variable to one application running in a local computer.

 

The problem started last Sunday with the Daylight Saving. By using MAX I am able to see that the cRIO time is wrong (1 hour less) and that the "Automatically adjust clock for Daylight Saving Time" is unchecked and gray, so I am unable to change it.

 

The time from the first loop by using the "Format Date/Time String" returns the time from cRIO (1 hour late), however the time from the second loop is correct. I have manually corrected time by using MAX, so now the first loop is correct, and the second is now 1 hour more.

 

Any ideias?

0 Kudos
Message 1 of 6
(3,408 Views)
Yes it does seem a similar problem.
By the way, I'm using the latest version of LabVIEW 2013 SP1 with the most recent drivers and toolkit versions. Is this a problem whaiting to be fixed for this long?
0 Kudos
Message 3 of 6
(3,383 Views)

I have found something new.

 

When usin the "Get Date/Time in Seconds" function on my cRIO I always gives one hour more since the Daylight Saving changed in March but the Daylight Saving is now activated on the cRIO and the time correct (according to MAX).

When using the "Format Date/Time String" function, I get the time correct.

 

Now I have tried to convert this string into a Time Stamp but the problem pressistest. I'm using the Bundle by name, I am putting 11 hours into the hours, and it results 12 hours on the Time Stamp on the output of the Bundle. (Please see the screen shot below).

 

Does any one have any idea?

0 Kudos
Message 4 of 6
(3,328 Views)

You are missing one of the inputs on the cluster which is "DST".  The element that defines whether the time is DST or not.

 

Rather than using the constant to define the cluster, changing only 1 element, and wiring almost all of the other elements straight across, just wire the cluster wire coming from the left directly into the top of the bundle by name.  Then you only have to use the Hour input in your Cluster Bundle by Name since it is the only one changing.  And you won't miss the DST element.

0 Kudos
Message 5 of 6
(3,312 Views)
Solution
Accepted by topic author Quintino

Dear RavensFan, thank you very much for your reply.

 

However that was not the problem. Apparently the result with or without the DST element is the same. I have solved the problem, for now, by changing one parameter not on the "Get Date/Time in Seconds" function but on the Time Stamp Indicator.

 

By right clicing the indicator and going to Display Format and Advanced editing mode I have changed the Format String to a Universal time container from this: %<%H:%M<T to %^<%H:%M<T.

 

Apparently the time from the "Get Date/Time in Seconds" is still one hour more, but now it is displayed correctly.

0 Kudos
Message 6 of 6
(3,304 Views)