Cron Time for DST Help

Apparently the Cron the time for the ONDATE trigger was set wrong and initiated a DST bit value to adjust the eWON devices back one hour but on the wrong day.

If the DST tag value is set to 1 then that’s supposed to be spring forward in the Spring and if the DST tag value is set to 0 then that’s supposed to fall back in the Fall.

It seems that at least the logic is not correct with the ONDATE 10, "0 3 25-31 10 *" as it updated it a little sooner than it was supposed to but I was curious is you guys could help me ensure both are correct for the DST change in American time zones from EST to PST—I just need help with the Cron numbers ensuring it only triggers when expected for that change.

What we were using in our Flexy 201 BASIC script

ONDATE 9, "0 2 25-31 3 *", "IF (DOW TIME$) = 0 THEN DST@ = 1"
ONDATE 10, "0 3 25-31 10 *", "IF (DOW TIME$) = 0 THEN DST@ = 0"
ONCHANGE "DST", "GOTO Adjust_GMT_offset"

Can you help me determine the correct numbers to pass to represent:

  1. Second Sunday of March
  2. First Sunday of November

I looked over some documents from the past and some old emails. I did some calculation with a calendar and based on the CRON Timer Interval format I come with the below:

ONDATE 9, "0 2 8-14 3 *", "IF (DOW TIME$) = 0 THEN DST@ = 1"
ONDATE 10, "0 2 1-7 11 *", "IF (DOW TIME$) = 0 THEN DST@ = 0"

So . . .

  • ONDATE 9, "0 2 8-14 3 *", "IF (DOW TIME$) = 0 THEN DST@ = 1"

    • should indicate the second Sunday of March at 2:00 AM of any year
  • ONDATE 10, "0 2 1-7 11 *", "IF (DOW TIME$) = 0 THEN DST@ = 0"

    • should indicate the first Sunday of November at 2:00 AM of any year

Does this look correct? I’ll be putting some logic in this to trigger an email to send to me and Joe too so we know when there has been a time zone change too per each eWON.

Thanks,
PJ

@PJ_IOT

This does look correct. This should trigger on the proper timeframes for daylight savings. The problem with the previous ONDATES is that they were set to occur on the LAST Sunday in October & March. You have however fixed that by shifting the time over.

1 Like

Thank you sir! Another set of eyes never hurts.

1 Like