Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time zone (DST) support for scheduled triggered webjobs #1783

Closed
HansOlavS opened this issue Oct 30, 2015 · 7 comments
Closed

Add time zone (DST) support for scheduled triggered webjobs #1783

HansOlavS opened this issue Oct 30, 2015 · 7 comments

Comments

@HansOlavS
Copy link

Right now scheduled triggered webjobs are using either Azure Scheduler or NCronTab with CRON-expressions and currently none of these support time zones or DST (Daylight Saving Time).

My issue is that I have a lot of jobs across many web apps set up to run at specific times of day, like 15:00 each day. And since I live in a timezone with DST all my schedules need to be manually edited each time summer-time or winter-time comes.

How could we fix this? I'm considering adding support for time zone and DST in the NCronTab and trying to create a pull-request for that (not sure how much work that would be, but I think it's doable).

Thoughts, anyone?

Interesting StackOverflow article: http://stackoverflow.com/questions/13195999/daylight-savings-and-cron

Another dude: http://codeofmatt.com/2013/11/04/windows-azure-scheduler/

Cheers!

@mathewc
Copy link
Contributor

mathewc commented Oct 30, 2015

Anything we discuss/decide is also relevant to TimerTrigger in the WebJobs SDK repo - it also uses NCronTab.

@ahmelsayed
Copy link
Member

you can potentially change the time zone for a site from UTC to whatever time zone you want using the WEBSITE_TIME_ZONE app setting, then let Windows deal with DST for you.

@HansOlavS
Copy link
Author

Thanks, @ahmelsayed, that will actually solve my problem! Sweet!

@HansOlavS
Copy link
Author

Damn I love Azure and App Service. It's pure gold.

@ghost
Copy link

ghost commented Aug 30, 2018

I have also written one web job ...which was running in UTC environment where as I want it to run in IST .. I just add application setting "WEBSITE_TIME_ZONE" with value "India Standard Time" and restarted web app. its solve my problem..simply great Azure !!

@Porkechebure
Copy link

Issue is still on rampage.
Azure is in UTC. I tried to set in my local.settings.json, servicebustrigger function this:
WEBSITE_TIME_ZONE: "Greenwich Standard Time" or either "GMT Standard Time"

to simulate in local the azure timezone (UTC+0).

Nothing. It keeps adding 1 hour becuase we are in the summer daylight saving timezone.

The only way I found is removing 1 hour with .AddHours(-1).

No class or timezone setting is available to remove the extra hour.

Not good.

@davidebbo
Copy link
Member

@Porkechebure that is by design. You need to set WEBSITE_TIME_ZONE as an Azure App Setting, and not in a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants