Results 1 to 3 of 3

Thread: Coverting MySQL date to date("D M j") HOW

  1. #1
    Join Date
    Jan 2005

    Question Coverting MySQL date to date("D M j") HOW

    I want to out put the day of the week from MySQL I know date() can convert the timestam but mysql date is not a time stam so im not really sure how to show the date in more useful way

    Can some on help me?
    2007-02-09 ==> Wed, July 02, 2007

    Thanks for help!
    What am I doing?

  2. #2
    Join Date
    Aug 2004
    Two choices:

    (1) Have your query return a UNIX timestamp value via the MySQL UNIX_TIMESTAMP() function.


    (2) Use the PHP strtotime() function to convert the date string from your query into a timestamp, e.g.:
    PHP Code:
    $formatted_date date('D M j'strtotime($row['date'])); 
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Jan 2005
    that works!

    Thanks a LOT!
    What am I doing?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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