PDA

View Full Version : PHP Time Conversion Help(plz)tx



RDWest2005
05 Aug 2005, 05:54 AM
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



<?= date('G\h i\m s\s', 25017); ?>

and returns ::: 1h 56m 57s

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

Rincewind
05 Aug 2005, 07:46 PM
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.