I'm in wordpress and write some php to get Pesrian and Arabic date from Gregorian. And I see this: Formatting DateTime object, respecting Locale::getDefault()
I want a function to get persian and arabic date each time function calls by simply change region and timezone
You can't use languages other than English with the standard
date/DateTimeconstructs in PHP. The only way to do this was to set the locale usingsetlocale()and use thestrfttime()function... however that function is now deprecated in favor of using the INTL/ICU extension'sIntlDateFormatterclass: