Got any ideas?
Todd
Moderator: General Moderators
Code: Select all
$monday = date('Y-m-d',strtotime('monday',time()-60*60*24*6));Code: Select all
$sunday = date('Y-m-d',strtotime('monday + 6 day',time()-60*60*24*6));Code: Select all
<?php
# $olddate is a datetime field from mysql
$timestamp = date('U', strtotime($olddate));
echo "Unix:" . $timestamp . "\n";
$monday = strtotime("last monday", $timestamp);
$mondate = date('Y-m-d', $monday);
echo "Monday:" . $mondate . "\n";
$sunday = strtotime("last monday + 6 day", $timestamp);
$sundate = date('Y-m-d', $sunday);
echo "Sunday:" . $sundate . "\n";
?>