Hi everyone. I know this is not really a cakephp problem and sorry for this, but anyone knows how to parse a date like 2016-05-20T09:00:000.000P
?
When i created a new time object, that format works fine:
>>> $t = new Time('2016-05-20T09:00:00.000P')
=> Cake\I18n\Time {#222
+"time": "2016-05-20T09:00:00-03:00",
+"timezone": "P",
+"fixedNowTime": false,
}
>>> $t->i18nFormat('yyyy-MM-dd HH:mm:ss','UTC')
=> "2016-05-20 12:00:00"
Now when i try to parse, i can’t extract the timezone part.
>>> Time::parseDateTime('2016-05-02T09:00:00.000P','yyyy-MM-dd\'T\'HH:mm:ss')
=> Cake\I18n\Time {#223
+"time": "2016-05-02T09:00:00+00:00",
+"timezone": "UTC",
+"fixedNowTime": false,
}
>>> Time::parseDateTime('2016-05-02T09:00:00.000P','yyyy-MM-dd\'T\'HH:mm:ssZ')
=> null
>>> Time::parseDateTime('2016-05-02T09:00:00.000P',"yyyy-MM-dd'T'HH:mm:ss'Z'")
=> Cake\I18n\Time {#205
+"time": "2016-05-02T09:00:00+00:00",
+"timezone": "UTC",
+"fixedNowTime": false,
}
Thanks