hi all,
how do i get the date for the nearest friday lets say 6 weeks from today.
so if the date lets say was stored in the database as:
2005-11-15
then i need 6 weeks and closest friday which would give me:
2005-12-30
date problem
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
This will give you the nearest friday *after* 6 weeks so you always get at least 6 weeks.
Code: Select all
$next_fri = strtotime('next friday'); //Gets timestamp for midnight on the next friday (or today if today is friday)
$_6_wks_fri = strtotime('+6 weeks', $next_fri);
echo date('jS M Y', $_6_wks_fri);hi d11wtq,
that works great but how can i make
a variable date. I have to pull the date out of a database and it needs to calculate the closest friday and then 6 weeks from there????
that works great but how can i make
Code: Select all
<?php
$next_fri = strtotime('next friday'); //Gets timestamp for midnight on the next friday (or today if today is friday)
?>