SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Convert timestamp?

    I'm having trouble displaying the right date, from my database.

    It goes in as: UNIX_TIMESTAMP(NOW())
    stored in db like (example): 1228457787

    For the example above x should '1228457787' output as 05 Dec 2008.

    I've tried different date(Y-m-d variations but it keeps outputting odd dates/years like 1969, 2000 etc

  2. #2
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    echo date("Y-m-d"1228457787); 
    No, I REALLY dislike having to use Joomla.

  3. #3
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually, for what you wanted...

    PHP Code:
    echo date("d M Y"1228457787); 
    have a look at the date() function, most notably the formatting characters.
    No, I REALLY dislike having to use Joomla.


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
  •