note 106043 deleted from function.strtotime by derick

From: Date: Sun, 14 Dec 2014 11:40:39 +0000
Subject: note 106043 deleted from function.strtotime by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-201187@lists.php.net to get a copy of this message
Note Submitter: besluitloos at gmail dot com ---- I just found out PHP thinks slashes in date-formats aren't very european: (I guess this is not a bug, just the way it works. But correct me if I'm wrong.) <?php $date = "06/10/2011 14:28"; // 6 october 2011 2:28 pm $otherDate = "06-10-2011 14:28"; // 6 october 2011 2:28 pm echo $stamp = strtotime($date) . "<br />"; // outputs 1307708880 echo $otherStamp = strtotime($otherDate) . "<br />"; // outputs 1317904080 echo date("d-m", $stamp); // outputs 10-06 echo date("d-m", $otherStamp); // outputs 06-10 ?>

« previous php.notes (#201187) next »