{"action":"created","issue":{"url":"https://api.github.com/repos/quartznet/quartznet/issues/317","repository_url":"https://api.github.com/repos/quartznet/quartznet","labels_url":"https://api.github.com/repos/quartznet/quartznet/issues/317/labels{/name}","comments_url":"https://api.github.com/repos/quartznet/quartznet/issues/317/comments","events_url":"https://api.github.com/repos/quartznet/quartznet/issues/317/events","html_url":"https://github.com/quartznet/quartznet/pull/317","id":123715341,"number":317,"title":"Handle DST better","user":{"login":"mj1856","id":1396388,"avatar_url":"https://avatars.githubusercontent.com/u/1396388?v=3","gravatar_id":"","url":"https://api.github.com/users/mj1856","html_url":"https://github.com/mj1856","followers_url":"https://api.github.com/users/mj1856/followers","following_url":"https://api.github.com/users/mj1856/following{/other_user}","gists_url":"https://api.github.com/users/mj1856/gists{/gist_id}","starred_url":"https://api.github.com/users/mj1856/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mj1856/subscriptions","organizations_url":"https://api.github.com/users/mj1856/orgs","repos_url":"https://api.github.com/users/mj1856/repos","events_url":"https://api.github.com/users/mj1856/events{/privacy}","received_events_url":"https://api.github.com/users/mj1856/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2015-12-23T19:59:00Z","updated_at":"2016-12-15T15:28:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/quartznet/quartznet/pulls/317","html_url":"https://github.com/quartznet/quartznet/pull/317","diff_url":"https://github.com/quartznet/quartznet/pull/317.diff","patch_url":"https://github.com/quartznet/quartznet/pull/317.patch"},"body":"This PR addresses the challenges of scheduling a daily event when considering daylight saving time transitions.\n\nFirst, it's worth pointing out that the Quartz.net documentation's description of how DST is handled is wrong.  It states multiple times ([in the FAQ here](http://www.quartz-scheduler.net/documentation/faq.html#daylight-saving-time-and-triggers), [in the CronTrigger Tutorial here](http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontrigger.html#notes), [in the Best Practices here](http://www.quartz-scheduler.net/documentation/best-practices.html#daylight-savings-time), and probably in the API docs somewhere) that an occurrence in the spring-forward gap could be _skipped_ and an occurrence in the fall-back overlap could execute _twice_.  **This is not actually the current implemented behavior**.\n\nThe current implemented behavior is actually:\n- In the spring, when a local time doesn't exist, run at the same moment in time as if the transition did not occur.\n- In the fall, when two occurrences exist with the same local time, run at the _standard time_ occurrence.\n\nThis behavior is ultimately coming from `TimeZoneInfo.GetUtcOffset`, which always returns the standard time offset when in doubt.\n\nWhile the spring behavior is fine, unfortunately the fall behavior is usually undesired in scheduling systems.  When there are two occurrences of the same local time, a daily event should be expected to run at the _first_ occurrence encountered, since time progresses in a forward direction.  The first occurrence corresponds to the _daylight_ time, not the _standard_ time.\n\nThis PR addresses this by adding an overload of `Quartz.Util.TimeZoneUtil.GetUtcOffset` that accepts a `DateTime`, and has the desired implementation.  Then throughout the code, anywhere that `TimeZoneInfo.GetUtcOffset` was used, this new method is used instead.\n\nUnit tests are included, and all existing unit tests pass.\n\nThe documentation should also be updated to reflect the actual behavior.  Thanks.\n"},"comment":{"url":"https://api.github.com/repos/quartznet/quartznet/issues/comments/267355664","html_url":"https://github.com/quartznet/quartznet/pull/317#issuecomment-267355664","issue_url":"https://api.github.com/repos/quartznet/quartznet/issues/317","id":267355664,"user":{"login":"drusellers","id":63355,"avatar_url":"https://avatars.githubusercontent.com/u/63355?v=3","gravatar_id":"","url":"https://api.github.com/users/drusellers","html_url":"https://github.com/drusellers","followers_url":"https://api.github.com/users/drusellers/followers","following_url":"https://api.github.com/users/drusellers/following{/other_user}","gists_url":"https://api.github.com/users/drusellers/gists{/gist_id}","starred_url":"https://api.github.com/users/drusellers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drusellers/subscriptions","organizations_url":"https://api.github.com/users/drusellers/orgs","repos_url":"https://api.github.com/users/drusellers/repos","events_url":"https://api.github.com/users/drusellers/events{/privacy}","received_events_url":"https://api.github.com/users/drusellers/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T15:28:14Z","updated_at":"2016-12-15T15:28:14Z","body":":clap:"}}
{"actor":{"display_login":"drusellers"}}