Running code once per month
I am not aware of the event handler function you are using.
But there is something strange to me. Could the function be called several times(or not at all) during the hh:mm of first Sunday of month?
should be one time on first sunday of the month.
(dt.day == 1 || dt.day == 2 || dt.day == 3 || dt.day == 4 || dt.day == 5 || dt.day == 6 || dt.day == 7) // first sunday of the month
the code above used since we don't know the date of the first sunday but we know that it would fall between date 1st to 7th.
// input variable input uchar InpReOptimizingStartHour = 05; input uchar InpReOptimizingStartMinute = 00; dt.hour == InpReOptimizingStartHour && dt.min == InpReOptimizingStartMinute) { // at specified hour
and on the hour and minute it will only runs once depending on the hour and minute that specified
already tested and it works like I want, even though at the end I change it to more simpler one.
Hi,
I want to run a code once a month on OnTimer() function and here's how I do it.
Does this correct way to do that?