How can I get the difference in number of days or weeks or months or years without using mathematics but by using a single function call in between two particular dates?
Or I have to use mathematics?
Suppose
$interval->format('%a')
Here by using %a
as the format string outputs the difference in number of days. So what will be for weeks or months or years? In datetime.format its said that
format
Format accepted by date().
But in date I found no format character as %a
.