php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1315 date ("zS") not reporting properly
Submitted: 1999-04-14 15:52 UTC Modified: 1999-04-14 18:19 UTC
From: brianj at pleiades dot solar-systems dot net Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.7 OS: Linux 2.0
Private report: No CVE-ID: None
 [1999-04-14 15:52 UTC] brianj at pleiades dot solar-systems dot net
the function date(), when passes the options:
z - day of year, and
S - add appropriate terminator for number,
displays incorrectly.

This script adequately conveys the difficulty:
<?
$today = date("zS");
PRINT "<CENTER>Today is the <STRONG>$today</STRONG> day of the year.</CENTER><BR>";
?>

Today(April 14, 1999), for example, it displays: Today is the 103th day of the year.

This happens on the 3.0.5 RPM, and also on a compiled 3.0.7,
configured with

./configure --with-apxs=/usr/sbin/apxs --with-mysql --with-apache=/usr/include --enable-track-vars

More or less straight out of the documentation.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-04-14 18:19 UTC] rasmus
Today is the 14th and as such the S string is fine.  Most people want the extension to match the day of the month, not the day of the year.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sun Oct 11 09:00:02 2026 UTC