ego0 Posted September 6, 2006 Share Posted September 6, 2006 I Have two dates both in the unix? formatCountdown to date September, 18, 2006, 4:17:00 1158567428anddate now September 6, 2006, 3:28:51 1157570931I having trouble making a countdown to the minutes and seconds left from the time the script is run to the countdown date. :( Not a live countdown. Link to comment https://forums.phpfreaks.com/topic/19942-minutes-remaining/ Share on other sites More sharing options...
obsidian Posted September 6, 2006 Share Posted September 6, 2006 i'm not sure i understand the format you're talking of. are the "1158567428" and "1157570931" representative of the times you have? if so, then just try something like this:[code]<?phpfunction getRemainder($time) { $now = time(); $diff = abs($time - $now); $res = array( 'mins' => floor($diff / 3600), 'secs' => ($diff % 3600) ); return $res;}$time = 1158567428; // countdown to$rem = getRemainder($time);echo "There are $rem[mins] minutes and $rem[secs] seconds left!";?>[/code]hope this helps Link to comment https://forums.phpfreaks.com/topic/19942-minutes-remaining/#findComment-87353 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.