php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1750 function date() formatting is broken
Submitted: 1999-07-20 11:55 UTC Modified: 1999-07-20 13:49 UTC
From: dmf14 at cornell dot edu Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Beta 1 OS: Linux 2.2.10 (RedHat 6.0) i686
Private report: No CVE-ID: None
 [1999-07-20 11:55 UTC] dmf14 at cornell dot edu
The special character 'g' is not recognized as a formatter for the date function anymore... In, PHP3, it was defined as:
g - hour, 12-hour format without leading zeros; i.e. "1" to "12"
but it no longer works.  'm','d', 'Y', 'i', 's', and 'a' seem to work fine, though.
The following script will output "07.20.99 g:54:02 am", for example.
<?
        $today = date("m.d.Y g:i:s a");
        echo "$today<br><br>\n";
?>

FYI, my configure line was: ./configure --with-apxs=/usr/sbin/apxs --with-mysql --enable-track-vars

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-20 13:00 UTC] andrey at cvs dot php dot net
Fixed in CVS.
 [1999-07-20 13:49 UTC] andrey at cvs dot php dot net
Forgot to close.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 13:00:02 2026 UTC