Issue while converting the date time to timestamp

$d = DateTime::createFromFormat('d-m-Y H:i:s', '2021-07-15T19:00:00.000Z');
if ($d === false) {
    die("Incorrect date string");
} else {
    echo $d->getTimestamp();
}

This is not working and displayed error "Incorrect date string"

Am i missing anything?



Read more here: https://stackoverflow.com/questions/68475865/issue-while-converting-the-date-time-to-timestamp

Content Attribution

This content was originally published by Pankaj at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: