PHP | IntlCalendar add() Function
The IntlCalendar::add() function is an inbuilt function in PHP which is used to add a signed amount of time to a field.
- Object oriented style:
bool IntlCalendar::add( int $field, int $amount )
- Procedural style:
bool intlcal_add( IntlCalendar $cal, int $field, int $amount )
- $cal: This parameter holds the IntlCalendar resource.
- $field: This parameter holds the IntlCalendar date/time field constants. It holds the integer value lies between 0 to IntlCalendar::FIELD_COUNT.
- $amount: The signed amount to add to the current field. If the value of amount is positive then it will moved forward and if the value of amount is negative then it will moved into the past.
Return Value: This function returns TRUE on success or FALSE on failure.
Below programs illustrate the IntlCalendar::add() function in PHP:
Sep 29, 2019, 9:19:29 AM Oct 6, 2019, 9:19:29 AM
Aug 29, 2024, 9:19:29 AM Aug 29, 2034, 9:19:29 AM Aug 29, 2034, 7:19:29 PM