$today = getdate()
then we have an array with all the current date
but it is possible to use the function getdate to get the date few days before?
for example: today we are tuesday august 1st, and I want to know wich date it was 5 days ago...
Thanks for your help...
There's 86400 seconds in a day, time() also returns the current UNIX timestamp, so.....
// get the date from 5 days ago: $old_date = getdate(time() - (86400 * 5));
there are lots of way. one would be:
$lookup = time() - (60*60*24*5); echo date('F l', $lookup);
obviously read up on the date function.
$today = getdate(); echo date ( 'M-d-Y', mktime (0,0,0,$today['mon'],$today['mday'] - 5,$today['year']) );
🙂