|
IntlCalendar::clearClear a field or all fields DescriptionObject-oriented style
public true IntlCalendar::clear(intnull
$field = null )Procedural style true intlcal_clear(IntlCalendar
$calendar , intnull $field = null )
Clears either all of the fields or a specific field. A cleared field is
marked as unset, giving it the lowest priority against overlapping fields or
even default values when calculating the time. Additionally, its value is set
to Parameters
Return Values
Always returns Changelog
Examples
Example #1 IntlCalendar::clear examples
The above example will output: After GregorianCalendar creation Array ( [0] => FIELD_ERA [1] => FIELD_YEAR [2] => FIELD_MONTH [3] => FIELD_DATE ) 15/03/2013 00:00:00 After the formatter requested the extended year Array ( [0] => FIELD_ERA [1] => FIELD_YEAR [2] => FIELD_MONTH [3] => FIELD_DATE [4] => FIELD_EXTENDED_YEAR ) After the year has been cleared, the date stays the same 15/03/2013 00:00:00 because FIELD_EXTENDED_YEAR is still set Array ( [0] => FIELD_ERA [1] => FIELD_MONTH [2] => FIELD_DATE [3] => FIELD_EXTENDED_YEAR ) bool(true) After the extended year has been cleared Array ( [0] => FIELD_ERA [1] => FIELD_MONTH [2] => FIELD_DATE ) 15/03/1970 00:00:00 After the fields are recalculated, extended year is set again (to 1970) Array ( [0] => FIELD_ERA [1] => FIELD_MONTH [2] => FIELD_DATE [3] => FIELD_EXTENDED_YEAR ) After calling variant with no arguments Array ( ) 01/01/1970 00:00:00 |