Scheduled functions with Daylight Savings Time

I’m using a scheduled function that runs monday to friday at 10 am in my timezone:

import { schedule } from "@netlify/functions";

schedule('0 8 * * 1-5', handler);

Last weekend, the clock went back by 1 hour, for daylight savings time. Causing this script to run at 9 am today.

Is there a way to account for this in the scheduler-syntax? I’ve found some references (not in netlify) for crontab-commands to run in specific defined timezones, but that does not seem to apply here.

I doubt we have done anything specific around this, but I have asked our team if it’s a feature request or if there is some existing syntax to help out in the future. I expect it won’t matter until 6 months hence :slight_smile:

I’ve also suggested that we add this to the docs (what timezone our functions run in, which presumably is UTC which never changes, but instead, your timezone changed relative to UTC so you saw the function run at the “normal” time for us, but an hour off from your expectation).

1 Like

Thanks for following up!
I do get it is an edge case and there are some ways around it that I can code myself (like firing the function twice and checking the time in my timezone in javascript).
But for now I’m just going to change the schedule twice a year, but I’ll keep an eye out on the docs for possible updates.

1 Like

Thank you for the update here. Truthfully, that approach might be the fastest and simplest way to accommodate for the time zone change. However, yes, if we ever do implement an update, it would be placed in our Docs. Thanks!