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: 

Time display will not show 4:00 PM, but works for any other time

Hello,

I've run into a weird issue.  I have a time display that is reading from a string.  The time display works fine for any time input except for 4:00:00 PM exactly.  If I change it by 1 second, it displays correctly.  If the time is a different hour (ie 3:00 PM), it works fine.

 

Any Thoughts?

 

Here is a small vi copy of the code that duplicates the same issue I am having.

 

Thanks for the help!

Scott

0 Kudos
Message 1 of 6
(1,382 Views)

You mean this isn't what you get? Maybe post what the indicator shows when you input that specific string.

 

2021-03-04 13_27_09-Clipboard.png

0 Kudos
Message 2 of 6
(1,376 Views)

I will have to guess that tyk007 is not in the Pacific Time Zone.  If you convert the timestamp to DBL you will see that for PST that 4 pm translates to midnight UTC and when no date is provided the implied date is the start of the LV epoch (1/1/1904).  This means that the DBL value is 0, and this value is treated differently by the Timestamp indicator as sort of a NaT (Not a Time) value.

 

TimeTest.png

Different time zones will have a different value which causes the same effect.

Message 3 of 6
(1,349 Views)

This same question just came up over a month ago.

 

Read this thread for more details.

Message 4 of 6
(1,332 Views)

Thank you all for the quick responses.  Darin.K you nailed it with the troubleshooting technique.  It makes total sense.  Adding the DBL indicator made it easy to see.  Also, thanks to RavenFan for the detailed follow up.

 

Knowing what was going on, I was able to go another direction for a solution for my application.

Test.jpg

0 Kudos
Message 5 of 6
(1,314 Views)

Actually the main problem is that you try to deal with a relative time but use an absolute timestamp value. This also has the additional problem that you have to deal with timezone offsets which can get difficult if you ever happen to have your application run in a different timezone.

 

However the relative time container does not support a format code for the AM/PM flag. It is however not very difficult to add that and create a VI if you really want to.

Relative Time.png

 

 

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 6
(1,264 Views)