{"action":"created","issue":{"url":"https://api.github.com/repos/cantino/huginn/issues/1355","repository_url":"https://api.github.com/repos/cantino/huginn","labels_url":"https://api.github.com/repos/cantino/huginn/issues/1355/labels{/name}","comments_url":"https://api.github.com/repos/cantino/huginn/issues/1355/comments","events_url":"https://api.github.com/repos/cantino/huginn/issues/1355/events","html_url":"https://github.com/cantino/huginn/issues/1355","id":141011726,"number":1355,"title":"Javascript Agent does not respect timezone","user":{"login":"elvetemedve","id":596431,"avatar_url":"https://avatars.githubusercontent.com/u/596431?v=3","gravatar_id":"","url":"https://api.github.com/users/elvetemedve","html_url":"https://github.com/elvetemedve","followers_url":"https://api.github.com/users/elvetemedve/followers","following_url":"https://api.github.com/users/elvetemedve/following{/other_user}","gists_url":"https://api.github.com/users/elvetemedve/gists{/gist_id}","starred_url":"https://api.github.com/users/elvetemedve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elvetemedve/subscriptions","organizations_url":"https://api.github.com/users/elvetemedve/orgs","repos_url":"https://api.github.com/users/elvetemedve/repos","events_url":"https://api.github.com/users/elvetemedve/events{/privacy}","received_events_url":"https://api.github.com/users/elvetemedve/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-15T15:38:15Z","updated_at":"2016-03-15T22:30:51Z","closed_at":null,"body":"When I set the \"**TIMEZONE**\" environment variable to a zone other than **the one set on the host**, GUI will reflect the changes, but when a `Date` object is created from a **Javascript Agent, it will use the time zone of the host** machine instead of the application.\r\n\r\nSteps to reproduce the issue:\r\n\r\n1. Set up a docker container following this guide https://github.com/cantino/huginn/blob/master/docker/multi-process/README.md and set the `TIMEZONE=Budapest` environment variable too. \r\n1. Start the application\r\n1. Create a new Javascript Agent, give it a name like `test`, and put the following lines to the code field:\r\n\r\n    ```javascript\r\n    Agent.check = function() {\r\n        var date = new Date();\r\n        this.createEvent({ 'time': date.getHours() + ':' + date.getMinutes()  });\r\n    };\r\n    Agent.receive = function() { \r\n    };\r\n    ```\r\n1. Click on the **Dry Run** button twice.\r\n\r\nYou will get a time which is in **UTC**. The expected time should be in **UTC+1** (Europe/Budapest zone).\r\n\r\nA quick workaround is to run `sudo dkpg-reconfigure tzdata` inside the Docker container and restart it after that."},"comment":{"url":"https://api.github.com/repos/cantino/huginn/issues/comments/197053539","html_url":"https://github.com/cantino/huginn/issues/1355#issuecomment-197053539","issue_url":"https://api.github.com/repos/cantino/huginn/issues/1355","id":197053539,"user":{"login":"elvetemedve","id":596431,"avatar_url":"https://avatars.githubusercontent.com/u/596431?v=3","gravatar_id":"","url":"https://api.github.com/users/elvetemedve","html_url":"https://github.com/elvetemedve","followers_url":"https://api.github.com/users/elvetemedve/followers","following_url":"https://api.github.com/users/elvetemedve/following{/other_user}","gists_url":"https://api.github.com/users/elvetemedve/gists{/gist_id}","starred_url":"https://api.github.com/users/elvetemedve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elvetemedve/subscriptions","organizations_url":"https://api.github.com/users/elvetemedve/orgs","repos_url":"https://api.github.com/users/elvetemedve/repos","events_url":"https://api.github.com/users/elvetemedve/events{/privacy}","received_events_url":"https://api.github.com/users/elvetemedve/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T22:30:51Z","updated_at":"2016-03-15T22:30:51Z","body":"@dsander I've tested your changes and I can confirm that it works well. Well done. :+1: "}}