Internationalization IntlDateFormatter::getCalendar
IntlDateFormatter::getCalendar
datefmt_get_calendar
(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)
IntlDateFormatter::getCalendar -- datefmt_get_calendar — IntlDateFormatter에 사용되는 달력 유형을 가져옵니다.
설명
객체 지향 스타일
public IntlDateFormatter::getCalendar(): int|false
절차 스타일:
datefmt_get_calendar(IntlDateFormatter $formatter
): int|false
매개변수
formatter
- 포맷터 리소스
반환 값
포맷터에서 사용 중인 달력 유형입니다. IntlDateFormatter::TRADITIONAL
또는 IntlDateFormatter::GREGORIAN
입니다. 실패 시 false
를 반환합니다.
Examples
예제 #1 datefmt_get_calendar() 예제
<?php
$fmt = datefmt_create(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
echo 'calendar of the formatter is : ' . datefmt_get_calendar($fmt);
datefmt_set_calendar($fmt, IntlDateFormatter::TRADITIONAL);
echo 'Now calendar of the formatter is : ' . datefmt_get_calendar($fmt);
?>
예제 #2 OO 예제
<?php
$fmt = new IntlDateFormatter(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
echo 'calendar of the formatter is : ' . $fmt->getCalendar();
$fmt->setCalendar(IntlDateFormatter::TRADITIONAL);
echo 'Now calendar of the formatter is : ' . $fmt->getCalendar();
?>
위의 예는 다음을 출력합니다.
calendar of the formatter is : 1 Now calendar of the formatter is : 0
기타
- datefmt_get_calendar_object() - 포맷터의 캘린더 개체 사본 가져오기
- datefmt_set_calendar() - 포맷터에서 사용하는 달력 유형을 설정합니다.
- datefmt_create() - 날짜 포맷터 만들기