Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-08-2008, 11:04 AM   PM User | #1
stfc_boy
Regular Coder

 
Join Date: Jun 2007
Posts: 310
Thanks: 86
Thanked 3 Times in 3 Posts
stfc_boy is an unknown quantity at this point
Outputting a date?

Hi All,

I have a date in my database in this format 2008-08-01 12:00:00

So when I want to print the date to my actual site I use this query:
PHP Code:
SELECT *, DATE_FORMAT(published'%W, %D %M, %Y') AS formatted_date 
Which outputs: Friday, 1st August, 2008
But how would I output the date in this format: Fri 8th Aug (No Year)
Thanks
Chris
stfc_boy is offline   Reply With Quote
Old 08-08-2008, 11:18 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Have you checked http://dev.mysql.com/doc/refman/5.0/...on_date-format
To remove the year, just remove , %Y part. Or do you want to change the date from 1 to 8 ?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:28 PM.


Advertisement
Log in to turn off these ads.