Jump to content

nico1234

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Everything posted by nico1234

  1. I want to have the timestamps of week numbers, this is working perfectly from the year 2011 to 2012. It refuses to switch to the year 2013. Do anyone know what i'm doing wrong?: <?php $year='2012'; $weekno='01'; $date = strtotime($year.'W'.$weekno); for($i=0;$i<55;$i++){ print date('d-m-Y W',$date)."\n"; $date=(weekno($date,'1'))."\n"; $date=(int)$date; } function weekno($date,$step=''){ $year=date('Y',$date); $weekno=date('W',$date); $date = strtotime($year.'W'.$weekno); if($step>0){ $date = strtotime($year.'W'.$weekno. '+1 week'); } if($step<0){ $date = strtotime($year.'W'.$weekno. '-1 week'); } return($date); } ?>
×
×
  • 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.