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

Ability to select timezone or using server time #16

Open
ralfbalzer opened this issue Sep 18, 2018 · 3 comments
Open

Ability to select timezone or using server time #16

ralfbalzer opened this issue Sep 18, 2018 · 3 comments

Comments

@ralfbalzer
Copy link

It would be create, if the schedule could be changed to use either the local server time. As my system in is in Europe, I need to configured the schedule with an offset.
Thanks for considering for a future version :-)

@mrahhal
Copy link
Owner

mrahhal commented Jan 16, 2020

Sorry I haven't seen this until now for some reason (a full year later!).

Are you talking about scheduling a delayed job and giving the due date? If so, the method already takes a DateTimeOffset, right? So maybe I'm misunderstanding.

@ralfbalzer
Copy link
Author

I had this issue as the scheduler is using UTC. My system however is in CET (which is -1 hour from UTC and 2 hours to EST during the summer).
I adjusted the scheulded hour (my jobs need to run at a certain time during the day).
For the summertime, I added an adjust like this:
int summerTimeAdjust = TimeZoneInfo.Local.IsDaylightSavingTime(DateTime.Now) ? 1 : 0;
So my schedule looks like this:
Cron.Weekly(DayOfWeek.Tuesday, 6 + summerTimeAdjust)

@mrahhal
Copy link
Owner

mrahhal commented Jan 16, 2020

Oh we're talking about cron jobs. Yeah I see, I realize now that I should have allowed for a timezone. This is a valid issue.

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

2 participants