Created
January 28, 2019 14:23
-
-
Save kylekatarnls/ee07c2fd8ec871c092db6f87d2a6b324 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 | |
setlocale(LC_TIME, "$lang.UTF-8", "$lang.utf8", $lang, strstr($lang, '_', true)); | |
$utcString = '2018-05-12 23:16:46.123456'; | |
$date = new DateTimeImmutable($utcString); | |
$localString = $date->setTimezone(new DateTimeZone($timezone))->format('Y-m-d H:i:s.u'); | |
echo strftime('%x %X', strtotime($localString)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment