Internationalization IntlDateFormatter::getCalendarObject

IntlDateFormatter::getCalendarObject

datefmt_get_calendar_object

(PHP 5 >= 5.5.0, PHP 7, PHP 8, PECL intl >= 3.0.0)

IntlDateFormatter::getCalendarObject -- datefmt_get_calendar_object — 포맷터의 캘린더 개체 사본 가져오기


설명

객체 지향 스타일

public IntlDateFormatter::getCalendarObject(): IntlCalendar|false|null

절차 스타일:

datefmt_get_calendar_object(IntlDateFormatter $formatter): IntlCalendar|false|null

이 포맷터에서 내부적으로 사용하는 달력 개체의 복사본을 얻습니다. 이 달력에는 형식(그레고리안, 일본어, 불교, roc, 페르시아어, 이슬람 등)과 포맷터에서 사용하는 형식 및 시간대와 일치하는 시간대가 있습니다. 개체의 날짜/시간이 지정되지 않았습니다.


매개변수

이 함수에는 매개변수가 없습니다.


반환 값

이 포맷터가 사용하는 내부 달력 객체의 복사본. 아무 것도 설정되지 않은 경우 null, 실패 시 false.


Examples

예제 #1 IntlDateFormatter::getCalendarObject() 예제

                  
<?php
$formatter = IntlDateFormatter::create(
    "fr_FR@calendar=islamic",
    NULL,
    NULL,
    "GMT-01:00",
    IntlDateFormatter::TRADITIONAL
);

$cal = $formatter->getCalendarObject();

var_dump(
    $cal->getType(),
    $cal->getTimeZone(),
    $cal->getLocale(Locale::VALID_LOCALE)
);
                  
                

위의 예는 다음을 출력합니다.

string(7) "islamic"
object(IntlTimeZone)#3 (4) {
  ["valid"]=>
  bool(true)
  ["id"]=>
  string(9) "GMT-01:00"
  ["rawOffset"]=>
  int(-3600000)
  ["currentOffset"]=>
  int(-3600000)
}
string(5) "fr_FR"
                

기타