Page 1 of 1

problem with dates

Posted: Sun Apr 19, 2009 3:07 pm
by yuri1992
hello to all ,
i have a date like 31.5.09 , i need to now what date was yesterday and what date be tomorrow
how i do this ?

thanks to all

Re: problem with dates

Posted: Sun Apr 19, 2009 3:24 pm
by requinix
Yesterday and tomorrow are easy. Maybe you're talking about the day before and the day after?

Break the date into month, day, and year parts, then feed them into mktime then into date. You can add and subtract 1 from the day safely, even if the result doesn't make sense - mktime is smart like that.

Re: problem with dates

Posted: Sun Apr 19, 2009 3:45 pm
by yuri1992
yes ok.
how i convert mktime to a date ?

Re: problem with dates

Posted: Sun Apr 19, 2009 4:14 pm
by requinix
I said "into date", not "into a date".

date is a function.