Calculate previous and next date from a variable
Posted: Fri Mar 04, 2005 8:02 am
Hello,
I need some help determining the next and previous dates from a variable. So far this is what I have tried but it keeps returning 1970-01-01
Note: $CurrentTime = 2005-03-04
Can anyone tell me why this doesn't return 2005-03-03 and more inportantly how to correctly calculate the next and previous days?
Thanks,
Lou
I need some help determining the next and previous dates from a variable. So far this is what I have tried but it keeps returning 1970-01-01
Code: Select all
$PreviousDay = date("Y-m-d",mktime(0,0,0,date("m",$CurrentTime) ,date("d",$CurrentTime)-1,date("Y",$CurrentTime)));Can anyone tell me why this doesn't return 2005-03-03 and more inportantly how to correctly calculate the next and previous days?
Thanks,
Lou