Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    310
    Thanks
    86
    Thanked 3 Times in 3 Posts

    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

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    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 ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •