{"action":"created","issue":{"url":"https://api.github.com/repos/centreon/centreon/issues/4443","repository_url":"https://api.github.com/repos/centreon/centreon","labels_url":"https://api.github.com/repos/centreon/centreon/issues/4443/labels{/name}","comments_url":"https://api.github.com/repos/centreon/centreon/issues/4443/comments","events_url":"https://api.github.com/repos/centreon/centreon/issues/4443/events","html_url":"https://github.com/centreon/centreon/issues/4443","id":156513924,"number":4443,"title":"Downtimes ponctuels - Erreur de Timezone","user":{"login":"bmareau","id":13255513,"avatar_url":"https://avatars.githubusercontent.com/u/13255513?v=3","gravatar_id":"","url":"https://api.github.com/users/bmareau","html_url":"https://github.com/bmareau","followers_url":"https://api.github.com/users/bmareau/followers","following_url":"https://api.github.com/users/bmareau/following{/other_user}","gists_url":"https://api.github.com/users/bmareau/gists{/gist_id}","starred_url":"https://api.github.com/users/bmareau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmareau/subscriptions","organizations_url":"https://api.github.com/users/bmareau/orgs","repos_url":"https://api.github.com/users/bmareau/repos","events_url":"https://api.github.com/users/bmareau/events{/privacy}","received_events_url":"https://api.github.com/users/bmareau/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/centreon/centreon/labels/Kind/Bug","name":"Kind/Bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/centreon/centreon/milestones/53","html_url":"https://github.com/centreon/centreon/milestones/2.8.0","labels_url":"https://api.github.com/repos/centreon/centreon/milestones/53/labels","id":1223686,"number":53,"title":"2.8.0","description":"","creator":{"login":"centreon","id":1890152,"avatar_url":"https://avatars.githubusercontent.com/u/1890152?v=3","gravatar_id":"","url":"https://api.github.com/users/centreon","html_url":"https://github.com/centreon","followers_url":"https://api.github.com/users/centreon/followers","following_url":"https://api.github.com/users/centreon/following{/other_user}","gists_url":"https://api.github.com/users/centreon/gists{/gist_id}","starred_url":"https://api.github.com/users/centreon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/centreon/subscriptions","organizations_url":"https://api.github.com/users/centreon/orgs","repos_url":"https://api.github.com/users/centreon/repos","events_url":"https://api.github.com/users/centreon/events{/privacy}","received_events_url":"https://api.github.com/users/centreon/received_events","type":"Organization","site_admin":false},"open_issues":55,"closed_issues":51,"state":"open","created_at":"2015-07-24T08:37:37Z","updated_at":"2016-07-01T13:38:45Z","due_on":"2016-06-28T22:00:00Z","closed_at":null},"comments":1,"created_at":"2016-05-24T13:55:00Z","updated_at":"2016-07-04T13:18:14Z","closed_at":null,"body":"Bonjour,\r\nIl y a un bug avec les downtimes ponctuels.\r\nCeux-ci se basent sur la timezone indiquée dans le fichier php.ini.\r\n\r\nLes downtimes récurrents, quand à eux, se base sur : \r\n- La Timezone de l'hôte\r\n- La Timezone de l'interface (Administration - Parameters - Centreon UI)\r\n\r\nEst-ce que la modification pourrait-être faite ?\r\nPS : Problème reproduit en 2.7.1 / 2.7.3 / 2.7.4\r\nCdlt"},"comment":{"url":"https://api.github.com/repos/centreon/centreon/issues/comments/230288633","html_url":"https://github.com/centreon/centreon/issues/4443#issuecomment-230288633","issue_url":"https://api.github.com/repos/centreon/centreon/issues/4443","id":230288633,"user":{"login":"garnier-quentin","id":9079781,"avatar_url":"https://avatars.githubusercontent.com/u/9079781?v=3","gravatar_id":"","url":"https://api.github.com/users/garnier-quentin","html_url":"https://github.com/garnier-quentin","followers_url":"https://api.github.com/users/garnier-quentin/followers","following_url":"https://api.github.com/users/garnier-quentin/following{/other_user}","gists_url":"https://api.github.com/users/garnier-quentin/gists{/gist_id}","starred_url":"https://api.github.com/users/garnier-quentin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garnier-quentin/subscriptions","organizations_url":"https://api.github.com/users/garnier-quentin/orgs","repos_url":"https://api.github.com/users/garnier-quentin/repos","events_url":"https://api.github.com/users/garnier-quentin/events{/privacy}","received_events_url":"https://api.github.com/users/garnier-quentin/received_events","type":"User","site_admin":false},"created_at":"2016-07-04T13:18:14Z","updated_at":"2016-07-04T13:18:14Z","body":"\r\nTimezone for not regular downtime are based on user timezone. But not in the right way.\r\nI'm in Europe/Paris hour for my user. I want to set a downtime to 4pm (so UTC time is 2pm). In the interface, i have the right time 4pm and 2 minutes. But the downtime will be active at 6 pm and 2 minutes.\r\n\r\nFrom the picker javascript (status/Services/serviceJS.php), we have 4pm and 2 minutes. It goes in the method 'AddSvcDowntime' (class/centreonExternalCommand.class.php) with 4pm and 2 minutes. It goes in following code:\r\n```\r\n if($host_or_centreon_time == \"0\"){\r\n            $start_time = $this->GMT->getUTCDateFromString($start);\r\n            $end_time = $this->GMT->getUTCDateFromString($end);\r\n  }\r\n```\r\n\r\nI have 'Etc/UTC' in my php.ini. So we will get the unix timestamp from 4pm in UTC ($sDate = new DateTime($date)). And after we set the timezone to Europe/Paris and get the timestamp. So that's why i have 6pm eventually.\r\n\r\nWith the following code it's working (only for the case!!! Don't apply it!):\r\n```\r\n if (isset($date) && isset($gmt)) {\r\n            if (!is_numeric($date)) {\r\n                $sDate = new DateTime($date, new DateTimeZone($this->getActiveTimezone($gmt)));\r\n            } else {\r\n                $sDate = new DateTime();\r\n                $sDate->setTimestamp($date);\r\n            }\r\n\r\n            #$sDate->setTimezone(new DateTimeZone($this->getActiveTimezone($gmt)));\r\n\r\n            $return = $sDate->getTimestamp();\r\n        }\r\n\r\n```\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"garnier-quentin"}}