{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/6162","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/6162/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/6162/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/6162/events","html_url":"https://github.com/cakephp/cakephp/issues/6162","id":64110865,"number":6162,"title":"cakephp 3.0  ORM Time instances for datetime column","user":{"login":"andraskende","id":23754,"avatar_url":"https://avatars.githubusercontent.com/u/23754?v=3","gravatar_id":"","url":"https://api.github.com/users/andraskende","html_url":"https://github.com/andraskende","followers_url":"https://api.github.com/users/andraskende/followers","following_url":"https://api.github.com/users/andraskende/following{/other_user}","gists_url":"https://api.github.com/users/andraskende/gists{/gist_id}","starred_url":"https://api.github.com/users/andraskende/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andraskende/subscriptions","organizations_url":"https://api.github.com/users/andraskende/orgs","repos_url":"https://api.github.com/users/andraskende/repos","events_url":"https://api.github.com/users/andraskende/events{/privacy}","received_events_url":"https://api.github.com/users/andraskende/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/Enhancement","name":"Enhancement","color":"bfe5bf"},{"url":"https://api.github.com/repos/cakephp/cakephp/labels/ORM","name":"ORM","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/31","html_url":"https://github.com/cakephp/cakephp/milestones/3.1.0","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/31/labels","id":919718,"number":31,"title":"3.1.0","description":"Backwards compatible with 3.0.x. Will require PHP 5.5\r\n\r\n### Specific issues\r\n\r\n* Adding the exception trace to the error view data. #6000 \r\n* Changed the translate behavior to support translation engines. #5958 \r\n* Database connection prefixes, or table prefixes.","creator":{"login":"lorenzo","id":37621,"avatar_url":"https://avatars.githubusercontent.com/u/37621?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenzo","html_url":"https://github.com/lorenzo","followers_url":"https://api.github.com/users/lorenzo/followers","following_url":"https://api.github.com/users/lorenzo/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo/subscriptions","organizations_url":"https://api.github.com/users/lorenzo/orgs","repos_url":"https://api.github.com/users/lorenzo/repos","events_url":"https://api.github.com/users/lorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo/received_events","type":"User","site_admin":false},"open_issues":47,"closed_issues":12,"state":"open","created_at":"2015-01-02T15:38:07Z","updated_at":"2015-03-25T14:24:10Z","due_on":"2015-07-26T04:00:00Z","closed_at":null},"comments":6,"created_at":"2015-03-24T22:02:25Z","updated_at":"2015-03-25T14:24:10Z","closed_at":"2015-03-25T14:24:10Z","body":"Hello,\r\n\r\nI'm trying to select some datetime with MAX() and MIN() and then format to users local time_zone.\r\nOnly the  'created' => 'created' returns time instance the others returns string.\r\n\r\n\r\n        $visits->select([\r\n            'ip_address',\r\n            'date_first' => \"CONVERT_TZ(MIN(created),'UTC', '$timezone')\",      // string\r\n            'date_first1' => 'MIN(created)',     // string\r\n            'created' => 'created',     // time instance\r\n            'created1' => 'created',     // string\r\n        ]);\r\n\r\nhttp://book.cakephp.org/3.0/en/views/helpers/time.html\r\nBecause the ORM returns Cake\\I18n\\Time instances for every timestamp and datetime column, you can use the methods there to do most tasks.\r\n\r\nThank you,\r\nAndras"},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/86048478","html_url":"https://github.com/cakephp/cakephp/issues/6162#issuecomment-86048478","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/6162","id":86048478,"user":{"login":"lorenzo","id":37621,"avatar_url":"https://avatars.githubusercontent.com/u/37621?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenzo","html_url":"https://github.com/lorenzo","followers_url":"https://api.github.com/users/lorenzo/followers","following_url":"https://api.github.com/users/lorenzo/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo/subscriptions","organizations_url":"https://api.github.com/users/lorenzo/orgs","repos_url":"https://api.github.com/users/lorenzo/repos","events_url":"https://api.github.com/users/lorenzo/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T14:24:10Z","updated_at":"2015-03-25T14:24:10Z","body":"Duplicate of https://github.com/cakephp/cakephp/issues/4283"}}