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'))); Link to comment https://forums.phpfreaks.com/topic/91578-how-do-i-code-a-date-based-off-of-db-data/ 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); ?> Link to comment https://forums.phpfreaks.com/topic/91578-how-do-i-code-a-date-based-off-of-db-data/#findComment-469075 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.