How can i convert a date in format yyyy-mm-dd
to month-dd-yyyy
in ro_RO locale ?
The date is outputed by <?php echo ($_GET["date"]);?>
How can i convert a date in format yyyy-mm-dd
to month-dd-yyyy
in ro_RO locale ?
The date is outputed by <?php echo ($_GET["date"]);?>
From PHP > 5.3 you can use IntlDateFormatter
$dt = new DateTime('2015-02-01'); // Date in yyyy-mm-dd format
$formatter = new IntlDateFormatter('ro_RO', IntlDateFormatter::SHORT, IntlDateFormatter::SHORT); // Set locale name
$formatter->setPattern('MMMM dd yyyy'); // Return date in month-dd-yyyy format
echo $formatter->format($dt); // Format date
See it in action : http://3v4l.org/bQNah