今天在亚洲/德黑兰 27 Ramadan 1438 。但PHP Intl
今天说的是 28 Ramadan 1438 。
有谁知道问题是什么?
$DateTime = new DateTime();
$IntlDateFormatter = new IntlDateFormatter(
'en_US@calendar=islamic',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Asia/Tehran',
IntlDateFormatter::TRADITIONAL);
echo $IntlDateFormatter->format($DateTime);
答案 0 :(得分:1)
试试这个:(将日历从伊斯兰改为伊斯兰民用)
$DateTime = new DateTime();
$IntlDateFormatter = new IntlDateFormatter(
'en_US@calendar=islamic-civil',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Asia/Tehran',
IntlDateFormatter::TRADITIONAL);
echo $IntlDateFormatter->format($DateTime);
答案 1 :(得分:1)
使用islamic-civil
代替islamic