note 42184 added to function.strtotime
| From: | Tananda at rn2 dot php dot net | Date: | Thu, 06 May 2004 19:27:22 +0000 |
| Subject: | note 42184 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69286@lists.php.net to get a copy of this message | ||
comment to this post:
author: rudigier at noxx dot at
28-Feb-2004 09:46
function to convert float times (eg. 4.5 h) in a real format (4h 30 min).
this function has a bug
for example 0.8 or 0.9 hours shows as 5 min instead of 54 min
I guess because of this line
if ( ($x[1]==1||$x[1]==2||$x[1]==3||$x[1]==4||$x[1]==5) && strlen((string)$x[1])==1)
$x[1]*=10; (only considering from 1 to 5)
this shold be changed to
if ( ($x[1]>=1&&$x[1]<=9)&& strlen((string)$x[1])==1)
$x[1]*=10; (should be 1 to 9 )
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42184
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42184&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42184&report=yes
Search -- http://master.php.net/manage/user-notes.php