#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    15
    Hello,

    I have a mysql field with a timestamp field. I'm using php to display it and it prints like "000815"

    My question is:

    Is there a way to make this display more friendly, ie: August 15, 2000

    Thanks for your help!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    81
    Rep Power
    15
    Use the DATE_FORMAT function. To get a date formatted how you want:
    select DATE_FORMAT( date_column, '%M %e, %Y' ) from mytable;
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    81
    Rep Power
    15
    Oh, URL to details about date functions:
    http://www.mysql.com/documentation/m...time_functions
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    15
    Thank you.

    Is this format:

    select DATE_FORMAT( date_column, '%M %e, %Y' ) from mytable;

    usable in php?
  8. #5
  9. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    You use it just like any other mysql query:

    $result=mysql_query("foo");

Similar Threads

  1. Mysql problem.
    By Nik in forum MySQL Help
    Replies: 54
    Last Post: December 21st, 2006, 06:02 PM
  2. Check if a mysql timestamp is from today or yesterday
    By kajic in forum PHP Development
    Replies: 0
    Last Post: February 3rd, 2004, 01:15 PM
  3. Starting MySQL
    By bwreath in forum MySQL Help
    Replies: 1
    Last Post: January 20th, 2004, 11:17 PM
  4. timestamp from MySQL into readable format pls
    By byte me in forum PHP Development
    Replies: 1
    Last Post: January 20th, 2004, 02:11 PM

IMN logo majestic logo threadwatch logo seochat tools logo