Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    82

    Unanswered: Converting UNIX Timestamps

    This is for use with a countdown timer, which is read from the database.


    Ok, basically I want a UNIX timestamp to be read from the database so:

    PHP Code:
    $result mysql_result("SELECT * FROM table");
    $row mysql_fetch_array($result);
    $timestamp $row['unixtime'];
    echo 
    $timestamp
    Which would result in:

    ------------------
    | 11025422... |
    ------------------

    Then I was wondering if it was possible to convert this into a User-Friendly date i.e You have: 14hours: 30mins!


    Thanks in advance for any help!


    ~Jordan

  2. #2
    Join Date
    Apr 2005
    Location
    Baltimore, MD
    Posts
    297
    use date() to format the timestamp.
    see http://us3.php.net/manual/en/function.date.php

  3. #3
    Join Date
    Aug 2004
    Posts
    82
    Cheers

Posting Permissions

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