{"action":"created","issue":{"url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/1241","repository_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications","labels_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/1241/labels{/name}","comments_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/1241/comments","events_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/1241/events","html_url":"https://github.com/katzer/cordova-plugin-local-notifications/issues/1241","id":214105495,"number":1241,"title":"Daylight Saving Accommodations Question?","user":{"login":"henryblackman","id":4824756,"avatar_url":"https://avatars3.githubusercontent.com/u/4824756?v=3","gravatar_id":"","url":"https://api.github.com/users/henryblackman","html_url":"https://github.com/henryblackman","followers_url":"https://api.github.com/users/henryblackman/followers","following_url":"https://api.github.com/users/henryblackman/following{/other_user}","gists_url":"https://api.github.com/users/henryblackman/gists{/gist_id}","starred_url":"https://api.github.com/users/henryblackman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henryblackman/subscriptions","organizations_url":"https://api.github.com/users/henryblackman/orgs","repos_url":"https://api.github.com/users/henryblackman/repos","events_url":"https://api.github.com/users/henryblackman/events{/privacy}","received_events_url":"https://api.github.com/users/henryblackman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-14T15:15:42Z","updated_at":"2017-03-14T21:42:42Z","closed_at":null,"body":"Hello,\r\n\r\nIt's not clear from the documentation, but do we need to concern ourselves with the upcoming change from winter time to daylight savings in most parts of the world.  I use notifications to reminder app users of their schedule, but do I need to adjust the time in which I schedule them by 1 hour forward?  For example (I'm in the UK so GMT/UTC time +0 hours currently) if I want a notification at 9am, do I schedule for 9am and expect it to be triggered at 9am local time or do I schedule for 8am and expect it to be triggered at 8am GMT/UTC which is actually 9am daylight savings (British Summer Time)?\r\n\r\nI ask because the Javascript Date object, I understand (but I could be wrong) stores the time in Unix time*1000.  I'm reticent to use local notifications at all unless I've got clarity as I've got 20k users who would receive multiple notifications a day, I don't want to be wrong!\r\n\r\nAny help would be appreciated."},"comment":{"url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/comments/286570174","html_url":"https://github.com/katzer/cordova-plugin-local-notifications/issues/1241#issuecomment-286570174","issue_url":"https://api.github.com/repos/katzer/cordova-plugin-local-notifications/issues/1241","id":286570174,"user":{"login":"henryblackman","id":4824756,"avatar_url":"https://avatars3.githubusercontent.com/u/4824756?v=3","gravatar_id":"","url":"https://api.github.com/users/henryblackman","html_url":"https://github.com/henryblackman","followers_url":"https://api.github.com/users/henryblackman/followers","following_url":"https://api.github.com/users/henryblackman/following{/other_user}","gists_url":"https://api.github.com/users/henryblackman/gists{/gist_id}","starred_url":"https://api.github.com/users/henryblackman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henryblackman/subscriptions","organizations_url":"https://api.github.com/users/henryblackman/orgs","repos_url":"https://api.github.com/users/henryblackman/repos","events_url":"https://api.github.com/users/henryblackman/events{/privacy}","received_events_url":"https://api.github.com/users/henryblackman/received_events","type":"User","site_admin":false},"created_at":"2017-03-14T21:42:42Z","updated_at":"2017-03-14T21:42:42Z","body":"After some testing, I've found the OS does NOT account for daylight saving.\r\n\r\nFundamentally, creating a notification requires passing a Date object.  The Date object in Javascript is based on unix time, and as such is precisely the number of seconds from 1st Jan 1970.  So for a time scheduled, for example at 10:30am will when moving from non-daylight saving time to daylight saving time, will mean the notification is triggered one hour late.\r\n\r\nTo resolve this, I've used moment-timezone to create the Date object and ensuring I include the timezone (e.g. Europe/London), and it automatically accounts for the change to daylight saving.  Now - it seems - that I can set an appropriately timed notification, which I've tested by rolling time time forward to after the time shift and it is triggered correctly."}}
{"actor":{"display_login":"henryblackman"}}