To display the Persian month and day names in PHP, you can use the IntlDateFormatter class with the PERSIAN calendar. Here's an example of how you can format the date in the desired format:

<?php
$timestamp = time(); // or use your own timestamp here

$formatter = new IntlDateFormatter('fa_IR@calendar=persian', IntlDateFormatter::FULL, IntlDateFormatter::FULL);
$formatter->setPattern('d F Y');

$persianDate = $formatter->format($timestamp);

echo $persianDate;
?>

In the code above, the IntlDateFormatter class is initialized with the fa_IR locale and the persian calendar. The FULL style is used for both the date and time. The setPattern method is used to define the desired format, where 'd' represents the day, 'F' represents the month, and 'Y' represents the year. The Persian date is then formatted using the format method of the formatter object, and finally, it is echoed out

i want php date format in persian descriptioni mean f M d

原文地址: http://www.cveoy.top/t/topic/iVOC 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录