clown[NOR] Posted May 6, 2007 Share Posted May 6, 2007 I think this will be quick... I'm making a script for a radio, to show the current show... I've got everything figured out... only problem is the time left... the end time is stored in the database formatted like this 00:00:00 so what I was thinking was just doing something like this: $current_time = date("H:i:s"); $end_time = $dbField['end']; $time_left = $current_time - $end_time; but that didn't work so i tried to remove the :'s but that didnt work either... anyone who could please guide me in the right direction? Thanks In Advance - Clown Quote Link to comment https://forums.phpfreaks.com/topic/50259-show-time-left/ Share on other sites More sharing options...
clown[NOR] Posted May 6, 2007 Author Share Posted May 6, 2007 damn.. I thought I had solved it... but then I suddenly noticed... it was 1 hour wrong... can someone please help out on this one? $ctime = date("H:i:s"); $etime = $dbField['end']; $time_left = strtotime($etime) - strtotime($ctime); $tl_hours = date("H", $time_left)."h "; $tl_mins = date("i", $time_left)."m "; $tl_secs = date("s", $time_left)."s "; $time_left = $tl_hours.$tl_mins.$tl_secs; Thanks In Advance - Clown Quote Link to comment https://forums.phpfreaks.com/topic/50259-show-time-left/#findComment-246720 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.