ID: 47513
Comment by: usrhlp at yahoo dot com
Reported By: usrhlp at yahoo dot com
Status: Open
Bug Type: Date/time related
Operating System: Debian
PHP Version: 5.2.8
New Comment:
I just tried it on another server I have with php 5.2.6 and i get this
result
18:00.01
18:00.10
18:01.40
18:16.40
20:46.40
21:46.40
07:46.40
12:46.40
That has totally thrown me off.
Previous Comments:
------------------------------------------------------------------------
[2009-02-26 22:59:30] usrhlp at yahoo dot com
Description:
------------
I am probably doing something wrong but I cannot for the life of me
figure out what it is.
I am trying to convert a small number to 24 hour time format. For
example I'm parsing the number 5 through the date function and I am
receiving the answer
01:00.05
I checked the PHP documentation and it shows as this for date()
H 24-hour format of an hour with leading zeros 00 through 23
According to the documentation 00 is a possible output of the H
formatting within date and should be what is coming out.
Reproduce code:
---------------
echo(date("H:i.s" ,1));
echo(date("H:i.s" ,10));
echo(date("H:i.s" ,100));
echo(date("H:i.s" ,1000));
echo(date("H:i.s" ,10000));
echo(date("H:i.s" ,100000));
echo(date("H:i.s" ,1000000));
echo(date("H:i.s" ,10000000));
Expected result:
----------------
time: 00:00.01
time: 00:00.10
time: 00:01.40
time: 00:16.40
time: 03:46.40
time: 04:46.40
time: 14:46.40
time: 18:46.40
Actual result:
--------------
time: 01:00.01
time: 01:00.10
time: 01:01.40
time: 01:16.40
time: 03:46.40
time: 04:46.40
time: 14:46.40
time: 18:46.40
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47513&edit=1