DateInterval::format

PHP 5 >= 5.3.0, PHP 7, PHP 8
DateInterval::format - Formats the interval
Manual
Code Examples

Example #1 DateInterval and DateTime::diff with the %a and %d modifiers

Result: 31 total days 1 month, 0 days
PHP Version:

Example #2 DateInterval example

Result: 4 days
PHP Version:

Example #3 DateInterval and carry over points

Result: 32 days
PHP Version:


Function DateInterval::format:

Date and Time Functions

Most used PHP functions