#40242 [Csd->Bgs]: 'D' Day of the week function not working properly
| From: | tony2001@php.net | Date: | Fri, 26 Jan 2007 14:43:38 +0000 |
| Subject: | #40242 [Csd->Bgs]: 'D' Day of the week function not working properly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108105@lists.php.net to get a copy of this message | ||
ID: 40242
Updated by: tony2001@php.net
Reported By: sankee at aol dot com
-Status: Closed
+Status: Bogus
Bug Type: Date/time related
Operating System: linux
PHP Version: 4.4.4
Previous Comments:
------------------------------------------------------------------------
[2007-01-26 14:30:29] sankee at aol dot com
Thank you!
------------------------------------------------------------------------
[2007-01-25 23:08:25] tony2001@php.net
You're looking into wrong manual.
You need a manual for your database, not PHP.
------------------------------------------------------------------------
[2007-01-25 23:02:17] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40242&edit=1