03-03-2021 06:09 PM
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
03-03-2021 06:28 PM - edited 03-03-2021 06:29 PM
You mean this isn't what you get? Maybe post what the indicator shows when you input that specific string.
03-03-2021 06:57 PM
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.
Different time zones will have a different value which causes the same effect.
03-03-2021 07:38 PM
03-03-2021 11:07 PM
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.
03-07-2021 08:04 AM
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.