note 42184 deleted from function.strtotime by aidan
| From: | aidan@php.net | Date: | Sat, 05 Jun 2004 04:18:43 +0000 |
| Subject: | note 42184 deleted from function.strtotime by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70647@lists.php.net to get a copy of this message | ||
Note Submitter: Tananda
----
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 )