DateInterval::formatFormats the interval Description
public string DateInterval::format
( string
$format
)Formats the interval. Parameters
Return ValuesReturns the formatted interval. Notes
Examples
Example #1 DateInterval example
<?php The above example will output: 4 days
Example #2 DateInterval and carry over points
<?php The above example will output: 32 days
Example #3 DateInterval and DateTime::diff with the %a and %d modifiers
<?php The above example will output: 31 total days 1 month, 0 days |