note 74874 added to function.mktime

From: Date: Tue, 01 May 2007 22:24:31 +0000
Subject: note 74874 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-126103@lists.php.net to get a copy of this message
<?php //the date of the variable holding the original date value $date = "2007-04-30"; //format the date for mktime() function -- you need day, month, year $year = substr($date, 0,4); $month = substr($date, 5, 2); $day = substr($date, 8, 2); //check the results echo $year; echo "<br>"; echo $month; echo "<br>"; echo $day; //the variable to hold the new date plus 14 days $new_date = date("Y-m-d", mktime(0, 0, 0, $month, $day +14, $year)); //check the results of new date echo "<br>"; echo $new_date; ?> ---- Server IP: 69.39.81.135 Probable Submitter: 66.124.89.145 ---- Manual Page -- http://www.php.net/manual/en/function.mktime.php Edit -- https://master.php.net/note/edit/74874 Del: integrated -- https://master.php.net/note/delete/74874/integrated Del: useless -- https://master.php.net/note/delete/74874/useless Del: bad code -- https://master.php.net/note/delete/74874/bad+code Del: spam -- https://master.php.net/note/delete/74874/spam Del: non-english -- https://master.php.net/note/delete/74874/non-english Del: in docs -- https://master.php.net/note/delete/74874/in+docs Del: other reasons-- https://master.php.net/note/delete/74874 Reject -- https://master.php.net/note/reject/74874 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126103) next »