Created
January 28, 2019 14:21
-
-
Save kylekatarnls/de2693230119bf162204f60f04841166 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$inputDateString = '2018-05-12 23:16:46.123456'; // get from DB or some API | |
$date = new DateTimeImmutable($inputDateString); | |
echo $date->format('Y-m-d\TH:i:s.u\Z'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment