PHP date_interval_format() Function
PHP Date/Time Reference Manual
Calculate the interval between two dates, then format the interval:
Example
format ( "Total number of days in the interval: %a days." ); ?>Run Example »
Definition and Usage
The date_interval_format() function is an alias of DateInterval::format().
The DateInterval::format() function formats a time interval.
Syntax
DateInterval::format(
format);
| Parameters | Description |
|---|---|
| format | Required. Specifies the format.format The parameter string can use the following characters:
|
Note:Every format string must be prefixed with a % sign!
|Technical Details
| Return Value: | Returns the formatted time interval. |
|---|---|
| PHP Version: | 5.3+ |
PHP Date/Time Reference Manual