LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Stamp Control and DST

I'm sure there's a way around this, but I can't find it...

 

I need to set a timestamp to 01:59:00 on the day DST starts. Unfortunately, LABVIEW recognises this as within the missing hour, and changes the timestamp back to 00:59:00

 

Is it possible to configure a timestamp control to ignore DST? Or is there some way of getting Labview to ignore DST all together?

 

Thanks for any help,

 

Jon.

0 Kudos
Message 1 of 8
(3,481 Views)

Tournifreak wrote:

I'm sure there's a way around this, but I can't find it...

 

I need to set a timestamp to 01:59:00 on the day DST starts. Unfortunately, LABVIEW recognises this as within the missing hour, and changes the timestamp back to 00:59:00

 

Is it possible to configure a timestamp control to ignore DST? Or is there some way of getting Labview to ignore DST all together?

 

Thanks for any help,

 

Jon.


Try shutting off "Automatically adjust clock for daylight..." under "date and Time Properties" if you are on a Windoze machine.

 

The Timestamp control uses the OS to translate times so shutting that option off MAY help (no I have never tried it).

 

"Under the hood" the "real time" (number of seconds since ...) is still the same. The issue is just how that value is interpreted and displayed. Under to definition of DST that time of day simply does not exist! This really goofs with you when you are trying to do something at the same time every day since one day has 23 hours and another day has 25 hours! But now i digress.

 

I hope that helps,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 8
(3,471 Views)

Ben wrote:

Try shutting off "Automatically adjust clock for daylight..." under "date and Time Properties" if you are on a Windoze machine.

 

The Timestamp control uses the OS to translate times so shutting that option off MAY help (no I have never tried it).

 


I just tried it. If I shut off the auto-control of DST in Windows, Labview does now allow me to set a timestamp control to the "missing hour. However, this isn't a great solution as DST is important to have set in the OS so other applications work OK.
I think what is really needed is an option in the properties of the timestamp control so that DST can be ignored.  The "Format Date/Time String" has such an option. Is there any reason why adding the option woudl be a bad idea, or is it just that no-one has thought of it?
Jon.
 
0 Kudos
Message 3 of 8
(3,463 Views)

As Ben pointed out it is difficult to fool the OS.

 

Can you use UTC internally and convert the display to local time when a user needs to see it?  UTC does not do DST.

 

Lynn 

0 Kudos
Message 4 of 8
(3,461 Views)

johnsold wrote:

As Ben pointed out it is difficult to fool the OS.

 

Can you use UTC internally and convert the display to local time when a user needs to see it?  UTC does not do DST.

 

Lynn 


If there was a way to display UTC with a timestamp control, yes. But I don't think there is.

Jon

0 Kudos
Message 5 of 8
(3,456 Views)
You could use DST, but write a section of code that subtracts an hour from the time stamp between the two dates?  I apologise if this is not possible - I'm not very familiar with time stamps, but i just thought I'd put the idea forward.


Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 6 of 8
(3,452 Views)

Hi Jon,

 

I hope I read latter about an easy method to achieve your end. Short of writing a custom version of the Timestamp control, I don't thing that option is built-in.

 

Is there anyway you can get that requirement lifted or loosened? After all it only affect two hours out of the year.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 8
(3,447 Views)

James Mamakos wrote:
You could use DST, but write a section of code that subtracts an hour from the time stamp between the two dates?  I apologise if this is not possible - I'm not very familiar with time stamps, but i just thought I'd put the idea forward.

Sorry James -that won't work.

The control itself over-rides what you enter. Try it:

Put a timestamp control on the front panel. Set the date to 29 Mar 09. Set the time to 01:30:00

The control changes itself back to 00:30:00.

 

(Because DST varies per region, this might not work if you're in GMT time zone. You could try the same thing with the appropriare dates/times in your own zone though)

 

Jon.

 


29/03/2009

0 Kudos
Message 8 of 8
(3,445 Views)