refiking Posted February 17, 2008 Share Posted February 17, 2008 I am trying to figure out how to make the $newdate variable 2 days after the $date and the time to be 12:00 noon. The $date variable is already in Y-m-d format. Here's what I've tried: $newdate = date('Y-m-d',mktime(0,0,0,$date('m'),$ date('d')+2,$date('Y'))); Quote Link to comment Share on other sites More sharing options...
Barand Posted February 17, 2008 Share Posted February 17, 2008 <?php $date = '2008-02-17'; $newdate = strtotime ("+2 days $date"); $newdate = strtotime ("+12 hours", $newdate); echo date ('d M y H:i', $newdate); ?> 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.