note 44917 added to function.strtotime

From: Date: Fri, 20 Aug 2004 01:38:21 +0000
Subject: note 44917 added to function.strtotime
Groups: php.notes 
Request: Send a blank email to php-notes+get-74966@lists.php.net to get a copy of this message
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() )); ?> ---- Manual Page -- http://www.php.net/manual/en/function.strtotime.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44917 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44917&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44917&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#74966) next »