Last active
October 23, 2022 16:35
-
-
Save superjojo140/2d4427b37205397dc7c03bcac7d7bcee to your computer and use it in GitHub Desktop.
Print UTC datetime-string as locale date in PHP
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 | |
$inputUtc = "2022-10-23T10:00:00"; | |
$dateObject = date_create($inputUtc,timezone_open("UTC")); | |
print_r($dateObject); | |
$timestamp = date_timestamp_get($dateObject); | |
date_default_timezone_set("Europe/Berlin"); | |
echo date("d.m.Y H:i",$timestamp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment