php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30034 date('zS') does not always return the correct value
Submitted: 2004-09-09 06:37 UTC Modified: 2004-09-09 08:09 UTC
From: michael at michaelthompson dot org Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.8 OS: *
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: michael at michaelthompson dot org
New email:
PHP Version: OS:

 

 [2004-09-09 06:37 UTC] michael at michaelthompson dot org
Description:
------------
date('zS') does not return the correct value on/above(?) day 251

Reproduce code:
---------------
date('zS'); # on (after ?) day 251

Expected result:
----------------
251st

Actual result:
--------------
251th

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-09 08:08 UTC] derick@php.net
Confirmed on Linux too, having a look now.
 [2004-09-09 08:09 UTC] derick@php.net
But it's not a bug. The S parameter uses the current day-of-the month to generate the suffix (with the 'j' parameter), and not the day-of-the-year value.

From http://php.net/date:
S	English ordinal suffix for the day of the month, 2 characters	 st, nd, rd or th. Works well with j
 [2011-01-22 23:47 UTC] loveme99hebe at yahoo dot com dot tw
home add:443-J JALAN SULTAN KG BARU 34000 TAIPING,PERAK,MALAYSIA
I/C KAD:830617-08-6215
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 17:01:28 2025 UTC