php - Google Calendar API Time -
when try format 2015-05-29t19:30:00+08:00
google calendar api;
return \carbon\carbon::createfromtimestamp( strtotime('2015-05-29t19:30:00+08:00') );
i result 2015-05-29 11:30:00
start date of event in google calendar 07:30pm
1 thing if try add ->diffforhumans();
result:
16 minutes ago
(note: time run code 7:46pm)
can me understand going on in here.
instead of converting datetime unix timestamp, try directly creating datetime instance using original date format iso8601, should automatically take account timezone
return carbon::createfromformat(carbon::iso8601, '2015-05-29t19:30:00+08:00');
Comments
Post a Comment