Script to notify users of the DST changes

I'm sharing a simple but useful script to notify you when the time changes on your router. You can also add alerts via Telegram or email.

:global lastGmtOffset
:local currentOffset [/system clock get gmt-offset]

:if ([:len $lastGmtOffset] = 0) do={
    :set lastGmtOffset $currentOffset
    :log info "GMT offset variable set to $currentOffset (UTC+$[:pick [:totime $currentOffset] 1 2])"

} else={
    :if ($lastGmtOffset != $currentOffset) do={
        :local lastGmtOffsetInfo "$lastGmtOffset (UTC+$[:pick [:totime $lastGmtOffset] 1 2])"
        :local currentOffsetInfo "$currentOffset (UTC+$[:pick [:totime $currentOffset] 1 2])"     
        :log info "DST updated: $lastGmtOffsetInfo => $currentOffsetInfo."
        :set lastGmtOffset $currentOffset
    }
}

The script (named, for example: check-offset) can be scheduled to run every hour using a scheduler.

/system scheduler
add interval=1h name=check-offset on-event=check-offset policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=2026-08-10 start-time=00:00:00

For what it's worth, using the NTP client the system already creates a log entry for time changes - all I had to do was to setup tools/e-mail, and create a log action and rule to have it sent to me (as well as any other desired log entries - the ntp time change is a "critical" for what it's worth. (And sounds like what you are doing also requires most of the mail setup.)

It detects time change or just checks if last offset is different then current one?
Time changes all the time as it passes.
How and when the internal clock is updated?

The system's internal clock is updated using only an NTP client that I have configured (the other option in IP/Cloud/, the "update time" option is unchecked).

I don't check the time change, which as you say changes continuously due to the high sensitivity of atomic clocks; I check the GMT Offset, which changes on the last Sunday of March and October.

Although the published script is just the base, you can improve it if you like. In my case, it notifies me via Telegram when GMT Offset has taken effect, something like this:

🕒 Apartment: Time change detected!
Time zone: Europe/Madrid
Previous Offset: 3600 (UTC+1)
Current Offset: 7200 (UTC+2)
Current DST: Summer Time
New Time: 09:38:03

That would be interesting, but in the log I've only seen NTP entries like this that report small variations in the current time:

ntp change time Jul/13/2026 11:36:47 => Jul/13/2026 11:37:13

I haven't seen anything that logs changes to the GMT Offset (admittedly, I don't have debugging enabled to avoid generating too much data in the log).

Any ideas are welcome.