I\'m trying to format a date passed from a google plus Api thats like the guide says in RFC 3339 format:
PUBLISHED-> datetime-> The time at which t
You don't need to use DateTime::createFromFormat()
for standard inputs. Just use:
$date = new DateTime('2014-01-22T10:36:00.222Z');
var_dump($date);
But if you still insist to use createFromFormat(), then use correct format, with microseconds:
$date = DateTime::createFromFormat('Y-m-d\TH:i:s.uP', '2014-01-22T10:36:00.222Z');
var_dump($date);