Results 1 to 2 of 2

Thread: PHP Time Conversion Help(plz)tx

  1. #1
    Join Date
    Aug 2005
    Posts
    5

    PHP Time Conversion Help(plz)tx

    wuzzup guys,
    i'm having trouble with converting the time from shoutcast servers

    the average listening time on this server is...
    the php script retrieves ( 25017 )
    the shoutcast server says :: 6h 56m 57s

    now i'm doing this

    PHP Code:
    <?= date('G\h i\m s\s'25017); ?>
    and returns ::: 1h 56m 57s

    what am i doing wrong here?
    any idea?
    tx
    RD

  2. #2
    Join Date
    Mar 2004
    Location
    China
    Posts
    3,315
    The date function expects a time value in the form of a Unix timestamp. The number should be the number of seconds between your date and the Unix Epoch (January 1 1970 00:00:00 GMT). So the timestamp 25017 translates to Thursday, January 1st 1970, at 6:56:57 (GMT). You probaly got 1:56:57 cause your on one of the USA times rather than GMT.

    Today's date, Saturday, August 6th 2005, 0:43:15 (GMT) translates to 1123288995. Clearly a much bigger number than you have.

Posting Permissions

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