{"action":"created","issue":{"url":"https://api.github.com/repos/copycat-killer/lain/issues/310","repository_url":"https://api.github.com/repos/copycat-killer/lain","labels_url":"https://api.github.com/repos/copycat-killer/lain/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/copycat-killer/lain/issues/310/comments","events_url":"https://api.github.com/repos/copycat-killer/lain/issues/310/events","html_url":"https://github.com/copycat-killer/lain/pull/310","id":205473357,"number":310,"title":"weather: fix for local vs utc time offset","user":{"login":"trap000d","id":2344260,"avatar_url":"https://avatars3.githubusercontent.com/u/2344260?v=4","gravatar_id":"","url":"https://api.github.com/users/trap000d","html_url":"https://github.com/trap000d","followers_url":"https://api.github.com/users/trap000d/followers","following_url":"https://api.github.com/users/trap000d/following{/other_user}","gists_url":"https://api.github.com/users/trap000d/gists{/gist_id}","starred_url":"https://api.github.com/users/trap000d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trap000d/subscriptions","organizations_url":"https://api.github.com/users/trap000d/orgs","repos_url":"https://api.github.com/users/trap000d/repos","events_url":"https://api.github.com/users/trap000d/events{/privacy}","received_events_url":"https://api.github.com/users/trap000d/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/copycat-killer/lain/milestones/4","html_url":"https://github.com/copycat-killer/lain/milestone/4","labels_url":"https://api.github.com/repos/copycat-killer/lain/milestones/4/labels","id":2275277,"number":4,"title":"release 1.0","description":"","creator":{"login":"copycat-killer","id":1777696,"avatar_url":"https://avatars0.githubusercontent.com/u/1777696?v=4","gravatar_id":"","url":"https://api.github.com/users/copycat-killer","html_url":"https://github.com/copycat-killer","followers_url":"https://api.github.com/users/copycat-killer/followers","following_url":"https://api.github.com/users/copycat-killer/following{/other_user}","gists_url":"https://api.github.com/users/copycat-killer/gists{/gist_id}","starred_url":"https://api.github.com/users/copycat-killer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copycat-killer/subscriptions","organizations_url":"https://api.github.com/users/copycat-killer/orgs","repos_url":"https://api.github.com/users/copycat-killer/repos","events_url":"https://api.github.com/users/copycat-killer/events{/privacy}","received_events_url":"https://api.github.com/users/copycat-killer/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":10,"state":"open","created_at":"2017-01-24T18:24:17Z","updated_at":"2017-08-14T16:35:43Z","due_on":"2017-10-14T07:00:00Z","closed_at":null},"comments":8,"created_at":"2017-02-06T02:03:47Z","updated_at":"2017-09-06T01:59:36Z","closed_at":"2017-02-07T08:09:03Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/copycat-killer/lain/pulls/310","html_url":"https://github.com/copycat-killer/lain/pull/310","diff_url":"https://github.com/copycat-killer/lain/pull/310.diff","patch_url":"https://github.com/copycat-killer/lain/pull/310.patch"},"body":"I've found you've removed all calls of ```read_pipe``` from code. Unfortunately it's caused a wrong time calculation in weather widget. So here is proposed fix \r\n1) a typo: one should subtract offset from local midnight to calculate UTC midnight\r\n2) lua ```os.time``` behavior differs from system utility ```date```\r\n``` date -u -d 'today 00:00:00' +'%%s' ``` calculates unix seconds for midnight in UTC time zone location, whereas os.time does it for midnight in local time zone. At some conditions (in my place - every day after 1PM) offset between these times becomes more then 24 hours and ````utc_m``` begins to point to yesterday."},"comment":{"url":"https://api.github.com/repos/copycat-killer/lain/issues/comments/327352516","html_url":"https://github.com/copycat-killer/lain/pull/310#issuecomment-327352516","issue_url":"https://api.github.com/repos/copycat-killer/lain/issues/310","id":327352516,"user":{"login":"trap000d","id":2344260,"avatar_url":"https://avatars3.githubusercontent.com/u/2344260?v=4","gravatar_id":"","url":"https://api.github.com/users/trap000d","html_url":"https://github.com/trap000d","followers_url":"https://api.github.com/users/trap000d/followers","following_url":"https://api.github.com/users/trap000d/following{/other_user}","gists_url":"https://api.github.com/users/trap000d/gists{/gist_id}","starred_url":"https://api.github.com/users/trap000d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trap000d/subscriptions","organizations_url":"https://api.github.com/users/trap000d/orgs","repos_url":"https://api.github.com/users/trap000d/repos","events_url":"https://api.github.com/users/trap000d/events{/privacy}","received_events_url":"https://api.github.com/users/trap000d/received_events","type":"User","site_admin":false},"created_at":"2017-09-06T01:59:36Z","updated_at":"2017-09-06T01:59:36Z","author_association":"CONTRIBUTOR","body":"Unfortunately it's not possible to work with UTC only: OWM returns all in UTC however you need to represent it to user in particular location, so you have to convert it to local time. Though conversion looks trivial (utc+offset), in some conditions difference between UTC time from OWM and local time might be more then 24 hours, and then.... https://xkcd.com/1883/"}}
{"actor":{"display_login":"trap000d"}}