Definition :
In php date_interval_format() Function is inbuilt function.PHP date_interval_format() function is used to format the interval of the given dates. It is an alias of DateInterval::format().
DateInterval::format(format)
Parameter | Description |
---|---|
format | Required. Specifies the format. The following characters can be used in the format parameter string:
Note: Each format character must be prefixed by a % sign! |
Given below example Calculate the interval between two dates, then format the interval:
Output :
Total number of days: 586.
Total number of days: +586.
Month: 7, days: 8.