note 103364 deleted from intldateformatter.create by danbrown
| From: | danbrown@php.net | Date: | Mon, 11 Apr 2011 15:33:58 +0000 |
| Subject: | note 103364 deleted from intldateformatter.create by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178696@lists.php.net to get a copy of this message | ||
Note Submitter: arash at NOSPAM dot php dot net
----
It seems that this page lacks documentation and examples, first it worth to know these:
First parameter is local, you can find the list of all possible locales here:
http://goo.gl/skfwB
if you want to use a calendar other than Georgian calendar you can define it in the first parameter,
for example you can use this to get the dates converted to Persian date "fa_IR@Persian",
possible calendars are:
Islamic, Persian, Hebrew, Chinese, and Japanese
Note that you should set the 5th parameter (calendar) to "IntlDateFormatter::TRADITIONAL"
if you want to use one of above calendars.
4th parameter is timezone which you can find the list of possible parameters here:
http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Here are some examples:
$fmt = new IntlDateFormatter(
"FA_IR@calendar=Persian",
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Asia/Tehran',
IntlDateFormatter::TRADITIONAL,
"EEEE d Y MMMM"
);
echo $fmt->format(0);
OUTPUT:
Ù¾ÙØ¬Ø´Ùب٠۱۱ Û±Û³Û´Û¸ دÛ
$fmt = new IntlDateFormatter(
"ja_JP@calendar=Japanese",
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Asia/Tokyo',
IntlDateFormatter::TRADITIONAL
);
echo $fmt->format(0);
OUTPUT:
æå45å¹´1æ1æ¥æ¨ææ¥ 9æ00å00ç§
æ¥æ¬æ¨æºæ
$fmt = new IntlDateFormatter(
"ar_AE@calendar=Islamic",
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Asia/Dubai',
IntlDateFormatter::TRADITIONAL,
"Y MMMM d EEEE HH:mm:SS"
);
echo $fmt->format(0);
OUTPUT:
١٣٨٩ Ø´ÙØ§Ù ٢٣ Ø§ÙØ®Ù
ÙØ³ Ù Ù¤:Ù Ù :Ù Ù