将YYYY-mm-dd转换为php中的特定区域设置名称


Convert YYYY-mm-dd to a specific locale name in php

如何在ro_ro区域设置中将格式为yyyy-mm-dd的日期转换为month-dd-yyyy

日期由<?php echo ($_GET["date"]);?> 输出

从PHP>5.3,您可以使用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

在行动中看到它:http://3v4l.org/bQNah