Hi,
For my application knowing the actual local time is important.
Say it's 8:16pm and I want a funtion to execute at 3:58AM. So I tell it to sleep for 7hrs plus 42min. I like sleep() that because I hear it saves resources. But what happens if it's daylight savings and clocks are offset an hour? Then it runs at the wrong time by an hour.
If I told the script to somehow check the system time every few seconds (loop _now) that would do it but I hear it's not an efficient wat to do it. Or, using the windows task scheduler, but the task scheduler can require a user password to run AFAIK, and I'm not into asking a user to do anything but set a time .
I could sleep for 30 sec then check the system clock then sleep another 30 secs the check...until it's time...(?)
I guess I'm finding a problem with any way I can think off. Maybe it's best to not have a user pick a time like 3:58AM but just pick a time interval to wait, and if they don't know it's Daylight savings it's their issue...
Any suggestions appreciated.
Thanks,