Jump to content

calculate days to total months?? Possible?


nikko50

Recommended Posts

Hi all. New to the forums:)

 

Is it possible to calculate the total number of months of I have a start and end date?So far I have the below that just calculates the total days between two dates. Now how can I get the toal months between the dates. For the below dates it should be around 19.5 or 20 or so.

 

$startDate = "2011-04-05";
$endDate = "2012-11-30";

$days =  (strtotime($endDate) - strtotime($startDate)) / (60 * 60 * 24);

 

 

Tracy

Link to comment
https://forums.phpfreaks.com/topic/263139-calculate-days-to-total-months-possible/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.