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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: martin dot meridius at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2026 The PHP Group
All rights reserved.
Last updated: Mon Oct 12 23:00:01 2026 UTC