11-10-2011 02:03 PM
I have this...
'In Range?' is always false no matter what the current time is. I'm guessing this is because the date is included in the compare function.
I need to compare these times and ignore the date. I cant seem to find a way around this. The times will be the same everyday and I'd like for them
to be constants.
Any help?
Thanks.
Solved! Go to Solution.
11-10-2011 02:33 PM - edited 11-10-2011 02:34 PM
11-10-2011 02:39 PM
Try formatting the date into a string that does not include the day (only the hours and minutes).
Tim W.
Applications Engineering
National Instruments
11-10-2011 02:46 PM
Found a small problem with my posted code, the inputs on the In Range and Coerce function need to be in the format HH:MM, not H:MM (7:15 should be formatted as 07:15)
Tim W.
Applications Engineering
National Instruments
11-10-2011 02:51 PM
Thanks Gerd and Tim.
I would not have though of trying to compare strings that way. The inrange and coerce knows its a time?
11-10-2011 02:53 PM
04-23-2020 06:11 PM - edited 04-23-2020 06:18 PM
Here's a different approach. What do ya'll think?
04-24-2020 03:55 AM - edited 04-24-2020 03:55 AM
04-24-2020 07:39 AM - edited 04-24-2020 07:48 AM
That won't work if you aren't in GMT and you are trying to compare times of day.
Let's say it is currently 11 pm. I want to see if it is after 6pm. I'm in eastern daylight savings time.
6pm today would give me a value that is higher (thus later) than 11 pm.
Luckily LabVIEW has this nice feature called subVI's that can hide the ugly parts of Chris's method and lets you reuse it. 😜
04-24-2020 07:57 AM
@RavensFan wrote:
That won't work if you aren't in GMT and you are trying to compare times of day.
That's why time zones and Daylight Savings Time should be banned and everybody just uses UTC.