phpretard Posted July 3, 2010 Share Posted July 3, 2010 I have this to set one limit on a calendar for today. I need another function that will return today() minus 18 years. function today(){ $current_date = date('Y-m-d'); return $current_date; } Can anyone help?? Thank you Quote Link to comment Share on other sites More sharing options...
Mchl Posted July 3, 2010 Share Posted July 3, 2010 date('Y-m-d',strtotime('18 years ago')) Quote Link to comment Share on other sites More sharing options...
coupe-r Posted July 3, 2010 Share Posted July 3, 2010 Would this work? $month = date("m"); $day = date("d"); $year = date("Y") - 18; $date = $year.'-'.$month.'-'.$day; Quote Link to comment Share on other sites More sharing options...
phpretard Posted July 3, 2010 Author Share Posted July 3, 2010 Would this work? $month = date("m"); $day = date("d"); $year = date("Y") - 18; $date = $year.'-'.$month.'-'.$day; Thank you!!! function age_limit(){ $month = date("m"); $day = date("d"); $year = date("Y") - 18; $date = $year.'-'.$month.'-'.$day; return $date; } Quote Link to comment Share on other sites More sharing options...
Mchl Posted July 3, 2010 Share Posted July 3, 2010 Whatever suits you... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.