note 48388 deleted from function.strtotime by tularis

From: Date: Tue, 21 Dec 2004 22:22:46 +0000
Subject: note 48388 deleted from function.strtotime by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-82144@lists.php.net to get a copy of this message
Note Submitter: infected_boy at hotmail dot com ---- Compares between two dates: (when some date is a string) $today=date("Y-m-d"); $somedate="12 21 2004 10:45:34"; list($month,$day,$year)=split(" ",$somedate); if(strlen($day) == 1){$day="0".$day;} //format day in two positions $somedate=date("Y-m-d",strtotime("$year-$mes-$dia")); //convert a string into date to compare if ($today >= $somedate){ // do sometihing $next_change = date("Y-m-d",strtotime("$year-$mes-$dia +10 day")); } ---- Reason: useless example

« previous php.notes (#82144) next »