php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40242 'D' Day of the week function not working properly
Submitted: 2007-01-25 23:02 UTC Modified: 2007-01-26 14:43 UTC
From: sankee at aol dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.4.4 OS: linux
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: sankee at aol dot com
New email:
PHP Version: OS:

 

 [2007-01-25 23:02 UTC] sankee at aol dot com
Description:
------------
According to the manual, when using date_format, %D should produce a 3 letter representation of the day of the week ('wed' for example).  But for me, it produces the day of the month with a suffix (23rd for example).

Also, %r should produce the rfc-822 date-time format ('Wed, 23 Jan 2007 12:00:00 EST' for example).  This isn't working for me either.  Instead it produces '12:00:00 PM'.

Am I missing something or is this not working right?





Reproduce code:
---------------
MY CODE ATTEMPTING TO USE %D:
SELECT news_title
, news_description
, news_id
, date_format(added, '%D, %d %M %Y %T') AS added
from news
ORDER BY added DESC
LIMIT 0,5

MY CODE ATTEMPTING TO USE %r:
SELECT news_title
, news_description
, news_id
, date_format(added, '%r') AS added
from news
ORDER BY added DESC
LIMIT 0,5



Expected result:
----------------
Wed



Wed, 02 Oct 2002 08:00:00 EST

Actual result:
--------------
23rd

12:00:00 PM

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-25 23:08 UTC] tony2001@php.net
You're looking into wrong manual.
You need a manual for your database, not PHP.
 [2007-01-26 14:30 UTC] sankee at aol dot com
Thank you!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 11:01:36 2025 UTC