note 44917 deleted from function.strtotime by danbrown

From: Date: Mon, 18 May 2009 02:30:34 +0000
Subject: note 44917 deleted from function.strtotime by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155657@lists.php.net to get a copy of this message
Note Submitter: tim at komta dot com ---- After a slight moment of frustration, and finding that I'm not the only one with this problem (see http://bugs.php.net/bug.php?id=28088 - it's a known bug) I decided to write a short workaround for dealing with the 00 hour problem. The problem only seems to occur when inputting strings such as '08/20/2004 0047' and NOT '08/20/2004 00:47'. Hence, my fix: <?php $your_value ( preg_replace ('#^(\d+/\d+/?\d{2,4} )(00)(\d{2})$#', '$1$2:$3', $your_value() )); ?>

« previous php.notes (#155657) next »