SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2003
    Location
    Portland, Maine
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Format MySQL DateTime value with PHP

    Any advice on how to format a MySQL DATETIME value into a more readable string? i.e. 6/16/2004 1:15 pm

  2. #2
    SitePoint Guru
    Join Date
    May 2004
    Location
    santa rosa, ca
    Posts
    969
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SELECT UNIX_TIMESTAMP(datefield)
    Use the returned value as the 2nd argument of the date function

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,014
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    use the mysql DATE_FORMAT function
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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