php - Google Calendar API Time
When I try to format2015-05-29T19:30:00+08:00
from google calendar api;
return \Carbon\Carbon::createFromTimeStamp(
strtotime('2015-05-29T19:30:00+08:00')
);
I get the result2015-05-29 11:30:00
But the start date of the event in my google calendar is exactly07:30PM
One thing is that if I try to add a->diffForHumans();
I get the result:
16 minutes ago
(Note: the time I run the code is 7:46PM)
Can you help me to understand what is going on in here.
Answer
Solution:
Instead of converting the datetime to a unix timestamp, try directly creating a DateTime instance using the original date format which is ISO8601, this should automatically take into account the timezone