note 102300 modified in function.date by danbrown

From: Date: Mon, 07 Feb 2011 16:41:53 +0000
Subject: note 102300 modified in function.date by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-176745@lists.php.net to get a copy of this message
The date function sometimes give wrong answers. This code will help you figure it out. <?php $d="2010-01-31 09:06:09"; $i= strtotime($d); echo $d; echo "<br>"; echo date("Y-m-d h:m:s",$i); ?> this gives the output: 2010-01-31 09:06:09 2010-01-31 09:01:09 very small change but still not accurate. --was-- The date function sometimes give wrong answers. This code will help you figure it out. $d="2010-01-31 09:06:09"; $i= strtotime($d); echo $d; echo "<br>"; echo date("Y-m-d h:m:s",$i); this gives the output: 2010-01-31 09:06:09 2010-01-31 09:01:09 very small change but still not accurate. http://php.net/manual/en/function.date.php

« previous php.notes (#176745) next »