Page 1 of 1
midnight rollover bug in WAIT UNTIL AT LEAST LOCALTIME
Posted: Sat Oct 21, 2023 1:35 am
by mfs4n
First, thanks so much for adding the WAIT UNTIL AT LEAST LOCALTIME command. Having it available has significantly simplified the development of night-long scripts to do many time gated occultation observations.
Now that the nights are getting longer I'm starting up the scripts before UTC midnight. I'm finding that once I get past the midnight boundary the sequence will skip right through the wait statement because it thinks, for example, 01:00 UTC has already happened on the day the script started (which is true, but not the intention of the wait statement since the 01:00 UT in question is on the subsequent calendar day). I don't really want to change my system clock to a non-UTC time zone, but could as a last resort.
I don't see anything in the log that is relevant to debugging this issue but happy to post one if it would help.
Thanks,
Mike.
Re: midnight rollover bug in WAIT UNTIL AT LEAST LOCALTIME
Posted: Sat Oct 21, 2023 1:45 pm
by admin
Hi Mike,
odd one, since as far as I can see the step does exactly what I intended it to, which is:
* As the step starts, get the date (local time date, not UTC)
* Add the specified time to the date to calculate a time point to wait until
* Wait until that time arrives (if it has happened already, carry on straight away)
Now, if your local time is set to UTC then the distinction between UTC and local time is irrelevant.
There is nothing in the code about the start time of the sequence, just the start time of that individual step, so if the step starts after midnight then it should wait for the set time. If it starts just before midnight then it will finish immediately, since the target time (03:00 or whatever) has already passed on that day.
If it still doesn't seem to be working right then please send me the log so I can check.
cheers,
Robin
Re: midnight rollover bug in WAIT UNTIL AT LEAST LOCALTIME
Posted: Sun Oct 22, 2023 2:02 pm
by mfs4n
Thanks. Let me try one more test this evening. I think what is happening is as you describe. I start a "wait until later than 01:00" at 23:45. Instead of waiting for one hour and fifteen minutes, the program decides that it is already past the 01:00 that occurred 22 hours and 45 minutes earlier and drops through the step. Any "wait until" starting after local midnight should be fine. A simple fix with the existing steps would be to insert a WAIT UNTIL LOCALTIME 00:05 or something like that when there is activity before midnight, so that the next "wait until later than" doesn't execute until after 00:00.
Re: midnight rollover bug in WAIT UNTIL AT LEAST LOCALTIME
Posted: Mon Oct 23, 2023 4:29 pm
by mfs4n
Ok. That's a workable solution - just don't start a "wait until later than" until you're on the same day as the time you care about in the future. A simple "WAIT UNTIL LOCALTIME 00:05" to hold off until after midnight gets me over the boundary.
Thanks,
Mike.
Re: midnight rollover bug in WAIT UNTIL AT LEAST LOCALTIME
Posted: Tue Oct 24, 2023 1:43 pm
by admin
Hi Mike,
yes, that's the right approach. The two different options of 'Wait Until XX:XX' and 'Wait Until later than XX:XX' I think cover all the options.
cheers,
Robin