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
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).
Thanks for following up!
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.
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!
I have to say this is the first time since using Netlify we have gone through Daylight savings time. Not being able to set the timezone for scheduled functions is pretty ridiculous.
Now to fix this we have to go through 20+ repositories and manually change every script twice per year and re-deploy everything. I, wrongly , presumed that scheduled functions would run based on the timezone set in our account. In fact the view on the scheduled function page even goes to the trouble to tell us that our scheduled function won’t run when we want it to.
I don’t believe this is an edge case at all. All other scheduled cron systems have the ability to do this by setting environment variables or passing a timezone to the function setting up the job.
@vultuk as a fellow Netlify user, I feel compelled to respond to your message, because it really bothered me. Everyone gets frustrated, and I’ve had my share with Netlify, but I imagine your attitude isn’t helping things nor inspiring the Netlify team to want to help you.
Some of my thoughts:
You’re comparing Firebase, which is a full-featured backend toolkit funded/operated by Google… and Netlify’s (which is primarily a front-end build and hosting service) “Scheduled Functions” service which is in BETA and clearly indicated as such. Calling the difference between their feature sets “ridiculous” is something I find really unfair, and again, demotivating.
Your complaint that you have to go through 20+ repositories and manually change every script etc. sounds like you implemented/deployed a feature without understanding how it would work. Blaming Netlify for your lack of rigor in implementing something you didn’t fully understand is misplacing your anger.
There are plenty of solutions other than changing every script twice per year… that IS ridiculous.
Here’s a one-liner example you can use to only run your script at 9 AM Los Angeles TZ:
Run this command every hour and it’ll only trigger when it’s the right time.
Even better, use environmental variables for both timezone and time, so you can update it without leaving the netlify GUI
P.S. I have spent 4 years dealing with this stuff because I coordinate scheduled push notifications to users in 16 different offsets on earth… so I get the frustrations in dealing with this, and wanting things to ‘just work’. I’m replying here because I think part of being a member of a community means staying positive and finding solutions.
In any case, I wish you the best on your project - and a great day.