Is there any way to use UTC? #95
Replies: 4 comments
-
Schedules are calculated irrespective of time zone so you it's up to the caller to decide how to have the resulting time interpreted and adjusted. |
Beta Was this translation helpful? Give feedback.
-
@VitorCioletti here's a dotnet fiddle script that may help in switching between local times and UTC. In our case, we store the NextOccurance in our database in UTC and we query in UTC, looking for jobs that are due to run. However, we allow the user to specify the cron expression in their local time (which means we need their timezone) In this script, I assume "America/Toronto" as the timezone, and get a schedule of runs between 9 and 17 local time. Hope that helps. |
Beta Was this translation helpful? Give feedback.
-
In theory, just "pretending" a DateTime has the proper timezone should do it. It won't handle anything like daylight saving times and so on though.. |
Beta Was this translation helpful? Give feedback.
-
Actually UTC is the only zone this library can handle due to mentioned DST nuances. |
Beta Was this translation helpful? Give feedback.
-
Does this library support any cron expression to use UTC timezone?
Beta Was this translation helpful? Give feedback.
All reactions