php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48039 date("S") doesn't return 0th values correctly
Submitted: 2009-04-21 20:33 UTC Modified: 2009-04-21 20:43 UTC
From: ether80 at yahoo dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2CVS-2009-04-21 (CVS) OS: Win XP & Mac 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: ether80 at yahoo dot com
New email:
PHP Version: OS:

 

 [2009-04-21 20:33 UTC] ether80 at yahoo dot com
Description:
------------
date("S") returns suffix "st" with zero, instead of "th".  

Reproduce code:
---------------
---
From manual page: function.date
---
date("30S")
date("20S")



Expected result:
----------------
30th
20th

Actual result:
--------------
30st
20st

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-21 20:43 UTC] derick@php.net
This is not a bug, date() modifiers use the date of the timestamp from the second argument, or the current date/time. Today is the 21st, so S giving "st" is correct.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Aug 16 12:00:02 2025 UTC