08-25-2016 06:44 AM - edited 08-25-2016 06:45 AM
I want to set a volume on my DUT based on the time of the day:
I set a Locals.CurrentTime = Time()
Well if I put the if statement:
Locals.CurrentTime >= "6:00:00 AM" && Locals.CurrentTime <= "6:00:00 PM"
and the time is 7:00 AM - this statement returns false....
Can someone clarify how to do this?
08-25-2016 08:24 AM
One way would be to get the hours and minutes of the day and then compare to the minutes since midnight.
Time(True,Locals.hour,Locals.minute)
Locals.MinutesSinceMidnight=Locals.hour*60+Locals.minute
Locals.TimeGood=Locals.MinutesSinceMidnight>=360 && Locals.MinutesSinceMidnight<=1080
You could change this to do seconds since midnight.