Page 1 of 1
Need help with some date logic...
Posted: Thu May 23, 2002 12:09 pm
by tarron
I'm trying to figure out how to calculate the date of the end of the week (saturday) based on the current date. For example, if the current date is 05-23-2002 (gmDate('m-d-Y')) getting the a result of 05-24-2002.
Any ideas?
Posted: Thu May 23, 2002 12:37 pm
by volka
Code: Select all
<?php $date = getdate();
$date = date('Y-m-d', mktime(0, 0, 0, $dateї'mon'], $dateї'mday']+(6-$dateї'wday']), $dateї'year']));
print($date);
?>
prints the next saturday
Thanks a lot.
Posted: Thu May 23, 2002 2:20 pm
by tarron
I appreciate the help.