I have a couple of form fields... one is a From date, one is a To date (for searches). I have the To date defaulting to todays date. To get the From date to default to 10 days prior to today, would this work correctly?
$date = date ("Y-m-d");
list ($year, $month, $day) = split ("-", $date);
$todayfrom = date ("m/d/Y", mktime (0,0,0,$month,$day-10,$year));
Since it's the system date I cannot change the date to verify. 🙂
Thanks.
Edit: forgot some of the code. 😉