anderlaini
anderlaini

Reputation: 1821

php - can't convert date from string

I want to get this date's timestamp from string. I'm trying:

DateTime::createFromFormat("Y-m-d", "2015-05-18T23:45:21.604Z");

But it returns nothing. I don't know which format is this.

Upvotes: 0

Views: 135

Answers (1)

user4628565
user4628565

Reputation:

try this,

$date = date_create_from_format('d/M/Y:H:i:s', '2015-05-18T23:45:21.604Z');
$date->getTimestamp();

Upvotes: 1

Related Questions