I have this date-time stamp:
"2021-06-08T13:09:00.9796129Z"
And I cannot convert it in to a DateTime object using CreateFromFormat. I am using a JanePHP Normaliser so would prefer to try and solve this strictly using CreateFromFormat. I have tried the following:
$options = [
\DateTimeInterface::ATOM,
\DateTimeInterface::COOKIE,
\DateTimeInterface::ISO8601,
\DateTimeInterface::RFC822,
\DateTimeInterface::RFC850,
\DateTimeInterface::RFC1036,
\DateTimeInterface::RFC1123,
\DateTimeInterface::RFC7231,
\DateTimeInterface::RFC2822,
\DateTimeInterface::RFC3339,
\DateTimeInterface::RFC3339_EXTENDED,
\DateTimeInterface::RSS,
\DateTimeInterface::W3C,
'Y-m-dTH:i:s.uP',
'Y-m-dTH:i:s.P',
'Y-m-dTH:i:s.vP',
];
foreach ($options as $name) {
var_dump(\DateTime::createFromFormat($name, "2021-06-08T13:09:00.9796129Z"));
}
All result in:
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
What is the correct format?