I am using PHP and mySQL to store a date using the mySQL date type.
I am getting today's date by using the standard date("Y-m-d"); - I need to get a date that is 90 days prior to today's date. If I do date("Y-m-d") - 90; I get 1913 and that's it. How can I go back 90 days from today's date?
Thanks!!
You will need to use the mktime() function
$date_from_db = "2003-03-26"; $your_date = explode("-", $date_from_db); echo date ("Y-m-d ", mktime (0,0,0,$your_date[1],$your_date[2]-90,$your_date[0]));