-
-
Save andreiglingeanu/cc8b612ca444c123a3a8f5a0c90a104d 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 | |
// $data_oarecare = "sâm, 11 mart. 2023 20:29:06 +0200"; | |
$data_oarecare = 'sâm, 11 mar. 2023 20:29:06 +0200'; | |
// Important | |
date_default_timezone_set("Europe/Bucharest"); | |
$fmt = datefmt_create( | |
"ro-RO", | |
\IntlDateFormatter::FULL, | |
\IntlDateFormatter::FULL, | |
'Europe/Bucharest', | |
\IntlDateFormatter::GREGORIAN, | |
'EEE, dd LLL YYYY HH:mm:ss Z' | |
); | |
echo "Doar timpul: " . date('H:i', datefmt_parse($fmt, $data_oarecare)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment