{"action":"created","issue":{"url":"https://api.github.com/repos/juggie/AlarmServer/issues/40","repository_url":"https://api.github.com/repos/juggie/AlarmServer","labels_url":"https://api.github.com/repos/juggie/AlarmServer/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/juggie/AlarmServer/issues/40/comments","events_url":"https://api.github.com/repos/juggie/AlarmServer/issues/40/events","html_url":"https://github.com/juggie/AlarmServer/issues/40","id":154311903,"number":40,"title":"feature req/help: TZ configurable (tornado branch)","user":{"login":"ikishk","id":1791496,"avatar_url":"https://avatars.githubusercontent.com/u/1791496?v=3","gravatar_id":"","url":"https://api.github.com/users/ikishk","html_url":"https://github.com/ikishk","followers_url":"https://api.github.com/users/ikishk/followers","following_url":"https://api.github.com/users/ikishk/following{/other_user}","gists_url":"https://api.github.com/users/ikishk/gists{/gist_id}","starred_url":"https://api.github.com/users/ikishk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikishk/subscriptions","organizations_url":"https://api.github.com/users/ikishk/orgs","repos_url":"https://api.github.com/users/ikishk/repos","events_url":"https://api.github.com/users/ikishk/events{/privacy}","received_events_url":"https://api.github.com/users/ikishk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-05-11T18:34:04Z","updated_at":"2016-06-25T00:45:05Z","closed_at":null,"body":"Timezone awareness?\r\n\r\nSo far I've done the following:\r\nalarmserver.cfg, line 11:\r\nlogurlrequests=True\r\n\r\n**## Timezone, UTC default\r\ntimezone=\"America/Chicago\"**\r\n\r\nconfig.py, line 18:\r\n        config.LOGURLREQUESTS = ....\r\n        **config.ASTZ = config.read_config_var('alarmserver', 'timezone', 'UTC', 'str')**\r\n        config.HTTPSPORT = .....\r\n\r\nstate.py, line 1:\r\n**#**import datetime\r\n**from datetime import datetime\r\nimport pytz**\r\n\r\n#alarmserver modules\r\nimport logger\r\nfrom config import config\r\nfrom events import events\r\n\r\n**##config.ASTZ='America/Chicago'\r\nutc_now = datetime.now()\r\nif config.ASTZ != 'UTC':\r\n  logger.debug('Timezone set to' + config.ASTZ)\r\n  tz = pytz.timezone(config.ASTZ)\r\n  now = tz.localize(utc_now)\r\nelse:\r\n  now = utc_now**\r\n\r\nclass state():\r\n\r\n\r\nrunning it like this gives me \"AttributeError: class config has no attribute 'ASTZ'\", uncommenting the ASTZ above works.\r\n\r\nThe API call shows the proper time using the timezone (\"datetime\": \"2016-05-11T13:17:00Z\"}), however the JS on the index page still shows UTC (Today at 8:17 AM).\r\n\r\nSo, 2 questions... \r\n1)why isn't it reading in the config file as expected?\r\n2)why isnt the index html/js/ajax page showing the API time?"},"comment":{"url":"https://api.github.com/repos/juggie/AlarmServer/issues/comments/228496843","html_url":"https://github.com/juggie/AlarmServer/issues/40#issuecomment-228496843","issue_url":"https://api.github.com/repos/juggie/AlarmServer/issues/40","id":228496843,"user":{"login":"juggie","id":2034757,"avatar_url":"https://avatars.githubusercontent.com/u/2034757?v=3","gravatar_id":"","url":"https://api.github.com/users/juggie","html_url":"https://github.com/juggie","followers_url":"https://api.github.com/users/juggie/followers","following_url":"https://api.github.com/users/juggie/following{/other_user}","gists_url":"https://api.github.com/users/juggie/gists{/gist_id}","starred_url":"https://api.github.com/users/juggie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juggie/subscriptions","organizations_url":"https://api.github.com/users/juggie/orgs","repos_url":"https://api.github.com/users/juggie/repos","events_url":"https://api.github.com/users/juggie/events{/privacy}","received_events_url":"https://api.github.com/users/juggie/received_events","type":"User","site_admin":false},"created_at":"2016-06-25T00:45:05Z","updated_at":"2016-06-25T00:45:05Z","body":"I will try to look at this weekend just moved been very busy.\nOn Jun 24, 2016 8:19 PM, \"rct\" <notifications@github.com> wrote:\n\n> On the current version of feature/tornado from Juggie's repo, All time\n> stamps are \"4 hours ago\". Setting eventtimeago to False didn't seem to fix\n> this. I don't know if that's implemented. yet.\n>\n> If I had to make a guess where 4 hours is coming from it is my offset from\n> GMT.\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/juggie/AlarmServer/issues/40#issuecomment-228494833>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe/AB8MRdENIqyPsYZ128Qu4Hi258FY7eMSks5qPHQlgaJpZM4IcXMe>\n> .\n>\n"}}
{"actor":{"display_login":"juggie"}}