Results 1 to 3 of 3
Thread: UNIX time to string
Jul 11, 2011, 15:04 #1
UNIX time to string
I have a unix timestamp: 7138 - the result of subtracting two timestamps and now I need to put it back to a string and pad it out with zeros so that I get: hh/mm/ss
if $resut is my timestamp (7138)
why can't I do:
$readable = date('H:i:s', $result);
when I echo this it comes out as:
20:58:58 but I know from using an online UNIX calculator that this should be:
01:58:58 What am I doing wrong???"Persistence is the path to perfection"
Jul 11, 2011, 15:14 #2
See this recent thread which had a very, very similar issue: http://www.sitepoint.com/forums/php-...re-768289.htmlSalathe
Software Developer and PHP Manual Author.
Jul 11, 2011, 15:29 #3
Thankyou so much for your help. has been such a pain to sort this"Persistence is the path to perfection"