note 22175 added to function.strftime

From: Date: Sun, 09 Jun 2002 14:21:04 +0000
Subject: note 22175 added to function.strftime
Groups: php.notes 
Request: Send a blank email to php-notes+get-31625@lists.php.net to get a copy of this message
//I needed the $end_date for an interval of $nights with a set $date_begin, in format 2002-06-01. it took me a long time to work this out for whom it could be usefull $date_begin = explode("-", $date);//$date is the date the user entered list($year, $month, $day) = $date_begin; $end_date = strftime("%Y-%m-%d", mktime(0,0,0,$month,$day+$nights,$year));//$nights being the interval echo "begin date $date_begin to $end_date"; -- http://www.php.net/manual/en/function.strftime.php http://master.php.net/manage/user-notes.php?action=edit+22175 http://master.php.net/manage/user-notes.php?action=delete+22175 http://master.php.net/manage/user-notes.php?action=reject+22175

« previous php.notes (#31625) next »