$time="08:05:00"; //for sake of example .initial time
$curtime="01:05:00";//end time
$t=explode(':',$time);
$h=intval($t[0]);
$m=intval($t[1]);
$add=1;
while($ntime!=$curtime)
{
$h=intval($h);
$m=intval($m);
$m+=$add;
if($m>=60)
{
$h++;
$m=$m-60;
}
if($h>23)
$h=0;
if($h<10)
{
$h="0".$h;
}
if($m<10)
{
$m="0".$m;
}
$ntime=$h.":".$m.":00";
echo $ntime."
"; //it will echo each minute
}
Helpopedia provides valuable information on a variety of topics such as computer hardware, graphics, web development, networking and the like. You can also post your problems and get them solved at the touch of a button. Also, if you are interested in sharing and writing, please contact us on the following e-mail address: dihaz09@gmail.com We look forward to your active participation and suggestions. Helpopedia™
Saturday, August 15, 2009
A simple code to handle Time
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment