Skip to content

Instantly share code, notes, and snippets.

@andreiglingeanu
Created March 12, 2023 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreiglingeanu/cc8b612ca444c123a3a8f5a0c90a104d to your computer and use it in GitHub Desktop.
Save andreiglingeanu/cc8b612ca444c123a3a8f5a0c90a104d to your computer and use it in GitHub Desktop.
<?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