MR.AspNetCore.Jobs icon indicating copy to clipboard operation
MR.AspNetCore.Jobs copied to clipboard

Ability to select timezone or using server time

Open ralfbalzer opened this issue 6 years ago • 3 comments

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 :-)

ralfbalzer avatar Sep 18 '18 08:09 ralfbalzer

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.

mrahhal avatar Jan 16 '20 06:01 mrahhal

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)

ralfbalzer avatar Jan 16 '20 12:01 ralfbalzer

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.

mrahhal avatar Jan 16 '20 12:01 mrahhal