{"action":"opened","issue":{"url":"https://api.github.com/repos/loopwxservices/WXKDarkSky/issues/9","repository_url":"https://api.github.com/repos/loopwxservices/WXKDarkSky","labels_url":"https://api.github.com/repos/loopwxservices/WXKDarkSky/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/loopwxservices/WXKDarkSky/issues/9/comments","events_url":"https://api.github.com/repos/loopwxservices/WXKDarkSky/issues/9/events","html_url":"https://github.com/loopwxservices/WXKDarkSky/issues/9","id":335121819,"node_id":"MDU6SXNzdWUzMzUxMjE4MTk=","number":9,"title":"Converting Sunrise/Sunset Times to Local time","user":{"login":"hartjosh","id":23486909,"node_id":"MDQ6VXNlcjIzNDg2OTA5","avatar_url":"https://avatars1.githubusercontent.com/u/23486909?v=4","gravatar_id":"","url":"https://api.github.com/users/hartjosh","html_url":"https://github.com/hartjosh","followers_url":"https://api.github.com/users/hartjosh/followers","following_url":"https://api.github.com/users/hartjosh/following{/other_user}","gists_url":"https://api.github.com/users/hartjosh/gists{/gist_id}","starred_url":"https://api.github.com/users/hartjosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hartjosh/subscriptions","organizations_url":"https://api.github.com/users/hartjosh/orgs","repos_url":"https://api.github.com/users/hartjosh/repos","events_url":"https://api.github.com/users/hartjosh/events{/privacy}","received_events_url":"https://api.github.com/users/hartjosh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-23T18:37:03Z","updated_at":"2018-06-23T18:37:03Z","closed_at":null,"author_association":"NONE","body":"How do you get the current day's sunrise and sunset?\r\n\r\nWhen I pull the daily sunrise and sunset and convert it from UTC to my local time zone, the time is off by a lot.  Is there something I am missing?\r\n\r\n    `// Sunrise Time:\r\n     if let daily = data.daily?.data[0],\r\n        let sunrise = daily.sunriseTime {\r\n            let sunriseString = sunrise.UTCToLocal()\r\n            self.sunriseTime = sunriseString\r\n        } else {\r\n            self.sunriseTime = na\r\n        }`\r\n\r\n    `extension Date {\r\n          func UTCToLocal() -> String {\r\n               let dateFormatter = DateFormatter()\r\n               dateFormatter.dateFormat = \"h:mm a\" // Output Format\r\n               dateFormatter.timeZone = TimeZone.current\r\n               let UTCToCurrentFormat = dateFormatter.string(from: self)\r\n              return UTCToCurrentFormat\r\n         }\r\n    }`\r\n\r\nRight now my current time is 2:35 PM and the sunrise and sunset times are:\r\nSunrise : 5:49 PM\r\nSunset: 8:24 AM\r\n"}}
{"actor":{"display_login":"hartjosh"}}