DateFormatter::setCalendar
datefmt_set_calendar
(No version information available, might be only in CVS)
datefmt_set_calendar — sets the calendar used to the appropriate calendar, which must be
Описание
Object oriented style
boolean DateFormatter::setCalendar
( integer $which
)
Procedural style
Sets the calendar used by the formatter.
Список параметров
- fmt
-
The formatter resource.
- which
-
The calendar to use. Default is DateFormatter::GREGORIAN.
Возвращаемые значения
Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.
Примеры
Пример #1 datefmt_set_calendar() example
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "calendar of the formatter is : ".datefmt_get_calendar($fmt);
datefmt_set_calendar($fmt,DateFormatter::TRADITIONAL);
echo "Now calendar of the formatter is : ".datefmt_get_calendar($fmt);
?>
Пример #2 OO example
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "calendar of the formatter is : ".$fmt->getCalendar();
$fmt->setCalendar(DateFormatter::TRADITIONAL);
echo "Now calendar of the formatter is : ".$fmt->getCalendar();
?>
Результат выполнения данного примера:
calendar of the formatter is : 1 Now calendar of the formatter is : 0
Коментарии
404 Not Found