php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #54271 martin.meridius@gmail.com
Submitted: 2011-03-16 13:45 UTC Modified: 2011-03-16 14:31 UTC
From: martin dot meridius at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3SVN-2011-03-16 (SVN) OS: Ubuntu 10.10
Private report: No CVE-ID: None
 [2011-03-16 13:45 UTC] martin dot meridius at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.getdate#Return Values
---
PHP 5.3.3-1ubuntu9.3 with Suhosin-Patch (cli) (built: Jan 12 2011 16:07:38)


$today = getdate();
$today[hours];

Returns 12-hours formatted, not 0 to 23 as described in documentation.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-16 14:20 UTC] rquadling@php.net
Can you run show the entire output of ...

php -r "print_r(getdate());"

please?
 [2011-03-16 14:20 UTC] salathe@php.net
-Status: Open +Status: Bogus
 [2011-03-16 14:20 UTC] salathe@php.net
It returns 24-hour values as documented.

php > print_r(getdate(1234567890));
Array
(
    [seconds] => 30
    [minutes] => 31
    [hours] => 23
    [mday] => 13
    [wday] => 5
    [mon] => 2
    [year] => 2009
    [yday] => 43
    [weekday] => Friday
    [month] => February
    [0] => 1234567890
)
 [2011-03-16 14:31 UTC] martin dot meridius at gmail dot com
-Summary: 12/24 formating of getdate() +Summary: martin.meridius@gmail.com
 [2011-03-16 14:31 UTC] martin dot meridius at gmail dot com
You're right, I'm sorry.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 23:01:30 2024 UTC