Jump to content

nikko50

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nikko50's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Why is it when I run the below code "Oct 11" is not in my array, but if I change the $endDate to "2012-10-30" it then will show up? What's up with that?? How can I fix this? Tracy $startDate = "2011-08-25"; $endDate = "2012-10-20"; $monthArray = array(); $i = 0; $sd = strtotime($startDate); $ed = strtotime($endDate); while ($sd < $ed) { $monthArray[$i] = date("M y", $sd); $sd = strtotime("+1 month", $sd); $i++; } print_r($monthArray);
  2. 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
×
×
  • 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.