<?php
echo "All 3 should show the fractions of second:\n";
echo var_dump((new \DateTime())->format('Y-m-d\TH:i:s.u'));
echo var_dump((new \IntlDateFormatter(
'en-US',
\IntlDateFormatter::FULL,
\IntlDateFormatter::FULL,
'UTC',
\IntlDateFormatter::GREGORIAN,
'yyyy-MM-dd HH:mm:ss.SSSSSS'
))->format(new \DateTime()));
echo var_dump(datefmt_create(
'en-US',
\IntlDateFormatter::FULL,
\IntlDateFormatter::FULL,
'UTC',
\IntlDateFormatter::GREGORIAN,
'yyyy-MM-dd HH:mm:ss.SSSSSS'
)->format(new \DateTime()));
preferences:
37.43 ms | 402 KiB | 5 Q