{"action":"created","issue":{"url":"https://api.github.com/repos/White-Tiger/T-Clock/issues/155","repository_url":"https://api.github.com/repos/White-Tiger/T-Clock","labels_url":"https://api.github.com/repos/White-Tiger/T-Clock/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/White-Tiger/T-Clock/issues/155/comments","events_url":"https://api.github.com/repos/White-Tiger/T-Clock/issues/155/events","html_url":"https://github.com/White-Tiger/T-Clock/issues/155","id":348961918,"node_id":"MDU6SXNzdWUzNDg5NjE5MTg=","number":155,"title":"Naming timezones","user":{"login":"bilogic","id":946010,"node_id":"MDQ6VXNlcjk0NjAxMA==","avatar_url":"https://avatars3.githubusercontent.com/u/946010?v=4","gravatar_id":"","url":"https://api.github.com/users/bilogic","html_url":"https://github.com/bilogic","followers_url":"https://api.github.com/users/bilogic/followers","following_url":"https://api.github.com/users/bilogic/following{/other_user}","gists_url":"https://api.github.com/users/bilogic/gists{/gist_id}","starred_url":"https://api.github.com/users/bilogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bilogic/subscriptions","organizations_url":"https://api.github.com/users/bilogic/orgs","repos_url":"https://api.github.com/users/bilogic/repos","events_url":"https://api.github.com/users/bilogic/events{/privacy}","received_events_url":"https://api.github.com/users/bilogic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-09T03:15:30Z","updated_at":"2018-08-14T05:46:02Z","closed_at":"2018-08-14T05:46:02Z","author_association":"NONE","body":"Hi,\r\n\r\nI was thinking of solely relying on Windows to determine the timezone and breaking up the problem into:\r\n\r\n1. A variable for ccTLD using IP address (If there is no IP address, Windows' local timezone won't change by itself as well)\r\n2. A variable for UTC offset\r\n3. A variable indicating if daylight savings is in effect\r\n\r\nThis 3 shown together should give a very clear idea of the current time \r\n\r\ne.g. for EST, display as ```US, -5```\r\nEDT, display as ```US, -4*``` or ```US, -5+1```\r\nKathmandu, Nepal as ```NP, +5.75```\r\nIf for any reason the ccTLD cannot be determined, display as ```--, +5.75```\r\nCan also introduce a translation table where ```UK, +0``` and ```UK, +1*```/```UK, +0+1``` will be translated to ```London```/```London*```\r\n\r\nI have not thought about the UI yet.\r\n\r\nThank you.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/White-Tiger/T-Clock/issues/comments/412761176","html_url":"https://github.com/White-Tiger/T-Clock/issues/155#issuecomment-412761176","issue_url":"https://api.github.com/repos/White-Tiger/T-Clock/issues/155","id":412761176,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjc2MTE3Ng==","user":{"login":"bilogic","id":946010,"node_id":"MDQ6VXNlcjk0NjAxMA==","avatar_url":"https://avatars3.githubusercontent.com/u/946010?v=4","gravatar_id":"","url":"https://api.github.com/users/bilogic","html_url":"https://github.com/bilogic","followers_url":"https://api.github.com/users/bilogic/followers","following_url":"https://api.github.com/users/bilogic/following{/other_user}","gists_url":"https://api.github.com/users/bilogic/gists{/gist_id}","starred_url":"https://api.github.com/users/bilogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bilogic/subscriptions","organizations_url":"https://api.github.com/users/bilogic/orgs","repos_url":"https://api.github.com/users/bilogic/repos","events_url":"https://api.github.com/users/bilogic/events{/privacy}","received_events_url":"https://api.github.com/users/bilogic/received_events","type":"User","site_admin":false},"created_at":"2018-08-14T05:46:02Z","updated_at":"2018-08-14T05:46:02Z","author_association":"NONE","body":"1. Adding this to ```format.c``` of the DLL will give the correct timezone based on system configuration,\r\n2. I'm hardcoding country code as -- for now, it will require a google lookup to resolve using http://maps.googleapis.com/maps/api/geocode/json?latlng=1.39389590785408,103.887348888627&sensor=false, positioning can be acquired using dotnet's ```GeoCoordinateWatcher```\r\n\r\n```\r\nelse if (*fmt == 'T' && wcsncmp(fmt, L\"TZOS\", 4) == 0) { // offset in hours\r\n\tTIME_ZONE_INFORMATION tz;\r\n\tDWORD rc = GetTimeZoneInformation(&tz);\r\n\tint offset_minutes;\r\n\tfloat offset_hours_f;\r\n\tint offset_hours;\r\n\toffset_minutes = -(tz.Bias + (TIME_ZONE_ID_DAYLIGHT != rc ? tz.StandardBias : tz.DaylightBias));\r\n\toffset_hours = offset_minutes / 60; \r\n\toffset_hours_f = offset_minutes / 60;\r\n\r\n\tif (offset_hours_f >= 0) *out++ = '+';\r\n\tif (offset_hours == offset_hours_f)\r\n\t{\r\n\t\tout += api.WriteFormatNum(out, offset_hours, 1, 0);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tchar* offset_s;\r\n\t\tint i, id, is;\r\n\r\n\t\toffset_s = _fcvt(offset_hours, 2, &id, &is); // Make it a String\r\n\t\tfor (i = 0; offset_s[0]; ++i) {\r\n\t\t\tif (i == id) { //--//-++-> id = Decimal Point Precision/Position\r\n\t\t\t\t*out++ = '.'; // ReInsert the Decimal Point Where it Belongs.\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t*out++ = *offset_s++; //--+++--> Done!\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tfmt += 4;\r\n}\r\nelse if (*fmt == 'T' && wcsncmp(fmt, L\"TZDS\", 4) == 0) { // daylight savings\r\n\tTIME_ZONE_INFORMATION tz;\r\n\tDWORD rc = GetTimeZoneInformation(&tz);\r\n\tif (rc == 2) *out++ = '*';\r\n\tfmt += 4;\r\n}\r\nelse if (*fmt == 'T' && wcsncmp(fmt, L\"TZCC\", 4) == 0) { //--++-> ISO Country Code:\t\t\t\r\n\t*out++ = '-';\r\n\t*out++ = '-';\r\n\tfmt += 4;\r\n}\r\n```"}}
{"actor":{"display_login":"bilogic"}}