Jump to content

date and week question


iperez_genius

Recommended Posts

Actually if u have a date, lest say 5/21/2007, u can use date() and mktime() to calculate the week. Im giving a simple example:

 

<?php
$date = '5/21/2007';
list($month, $day, $year) = explode('/', $date);
$week = date('W', mktime(0, 0, 0, $month, $day, $year));
echo $week;
?>

 

Hope it makes sense and helps.

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.