may i know how to get yesterday's date from today's date ? (date("y-m-d") )
yesterday's date?
Hi,
you can use the mktime function in order to create a timestamp that can be used with the date function.
Thomas
Originally posted by tsinka
Hi,
you can use the mktime function in order to create a timestamp that can be used with the date function.
Thomas
oh!! i've got the idea, thanks
Or you could take a look at [man]strtotime[/man] for generating the timestamp.
Be sure to fully read the strtotime() syntax - it can manage things like:
echo date("m", strtotime("last week"));
$date = date("Y-m-d", strtotime("-1 day"));
Should do the job. You get the idea.
Sigh. Give someone an easy answer and he'll code for a day. Give them a link to the manual and they might stop asking easy questions