{"action":"created","issue":{"url":"https://api.github.com/repos/picqer/exact-php-client/issues/85","repository_url":"https://api.github.com/repos/picqer/exact-php-client","labels_url":"https://api.github.com/repos/picqer/exact-php-client/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/picqer/exact-php-client/issues/85/comments","events_url":"https://api.github.com/repos/picqer/exact-php-client/issues/85/events","html_url":"https://github.com/picqer/exact-php-client/issues/85","id":185766419,"number":85,"title":"Date handling","user":{"login":"kvij","id":19838921,"avatar_url":"https://avatars.githubusercontent.com/u/19838921?v=3","gravatar_id":"","url":"https://api.github.com/users/kvij","html_url":"https://github.com/kvij","followers_url":"https://api.github.com/users/kvij/followers","following_url":"https://api.github.com/users/kvij/following{/other_user}","gists_url":"https://api.github.com/users/kvij/gists{/gist_id}","starred_url":"https://api.github.com/users/kvij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvij/subscriptions","organizations_url":"https://api.github.com/users/kvij/orgs","repos_url":"https://api.github.com/users/kvij/repos","events_url":"https://api.github.com/users/kvij/events{/privacy}","received_events_url":"https://api.github.com/users/kvij/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-27T20:03:37Z","updated_at":"2016-11-07T16:06:56Z","closed_at":null,"body":"Unfortunately to late or 3.0 I wanted to add another possibly breaking change. The biggest question is how to go about it. \nWe get this weird '/Data(microtime)/' string what should be a DateTime object when working with it and than again transformed back in the json body.\nThe problem is that we have no good indication of what elements to transform. We could check for '/Date(' on each property in `Model->fill()` and perhaps fill another array so we don't have to look for DateTime objects in the `Model->json()` method. Or we could add some Type info in the Entity declarations like ['StartDate' => 'DateTime'] or even a separate property type hints.\nAlso some suggestions on where to place timezone information is welcome. Connection is the only long lived object in the current model. Perhaps we can trigger the DateTime object replacement only when timezone is set for backward compatibility.\nPlease let me know what you think!\n\nFor anyone reading this and in need of a solution now:\n\n```\nfunction exactToDateTime($exact) {\n        $timestamp = substr($exact, 6, 10);\n        $date = new \\DateTime();\n        $date->setTimestamp($timestamp);\n        return $date;\n}\n```\n"},"comment":{"url":"https://api.github.com/repos/picqer/exact-php-client/issues/comments/258878164","html_url":"https://github.com/picqer/exact-php-client/issues/85#issuecomment-258878164","issue_url":"https://api.github.com/repos/picqer/exact-php-client/issues/85","id":258878164,"user":{"login":"Pirabarlen-Cheenaramen","id":16561966,"avatar_url":"https://avatars.githubusercontent.com/u/16561966?v=3","gravatar_id":"","url":"https://api.github.com/users/Pirabarlen-Cheenaramen","html_url":"https://github.com/Pirabarlen-Cheenaramen","followers_url":"https://api.github.com/users/Pirabarlen-Cheenaramen/followers","following_url":"https://api.github.com/users/Pirabarlen-Cheenaramen/following{/other_user}","gists_url":"https://api.github.com/users/Pirabarlen-Cheenaramen/gists{/gist_id}","starred_url":"https://api.github.com/users/Pirabarlen-Cheenaramen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pirabarlen-Cheenaramen/subscriptions","organizations_url":"https://api.github.com/users/Pirabarlen-Cheenaramen/orgs","repos_url":"https://api.github.com/users/Pirabarlen-Cheenaramen/repos","events_url":"https://api.github.com/users/Pirabarlen-Cheenaramen/events{/privacy}","received_events_url":"https://api.github.com/users/Pirabarlen-Cheenaramen/received_events","type":"User","site_admin":false},"created_at":"2016-11-07T16:06:56Z","updated_at":"2016-11-07T16:06:56Z","body":"    public function __get($key)\r\n    {\r\n        if (isset($this->attributes[$key])) {\r\n            if (is_string($this->attributes[$key])\r\n                && preg_match(\r\n                    '(\\/Date\\(\\d+\\)\\/)', $this->attributes[$key]\r\n                )\r\n            ) {\r\n                return $this->exactToDateTime($this->attributes[$key]);\r\n            }\r\n            return $this->attributes[$key];\r\n        }\r\n    }\r\n\r\n\r\n?"}}
{"actor":{"display_login":"Pirabarlen-Cheenaramen"}}