
IntlCalendar::clear() 메서드는 지정된 필드만 초기화합니다. 예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$calendar = new IntlCalendar('Asia/Seoul');
$calendar->set(2024, 1, 1, 12, 0, 0);
$calendar->clear(IntlCalendar::FIELD_HOUR_OF_DAY);
echo $calendar->get(IntlCalendar::FIELD_HOUR_OF_DAY) . "n"; // 0
IntlCalendar::reset() 메서드는 모든 필드 값을 초기화합니다. 예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$calendar = new IntlCalendar('Asia/Seoul');
$calendar->set(2024, 1, 1, 12, 0, 0);
$calendar->reset();
echo $calendar->get(IntlCalendar::FIELD_HOUR_OF_DAY) . "n"; // 0
IntlCalendar::clear() 메서드는 지정된 필드만 초기화합니다. IntlCalendar::reset() 메서드는 모든 필드 값을 초기화합니다.
2025-05-19 00:37