Mega Code Archive

 
Categories / Php / Date Time
 

Generating the days in a month

<?php $now = time(); if (3 < strftime('%H', $now)) { $now += 7200; } $this_month = strftime('%m',$now); $day = mktime(0,0,0,$this_month,1); $month_end = mktime(0,0,0,$this_month+1,1); while ($day < $month_end) {   print strftime('%c',$day);    $day += 86400; } ?>