hi
i have an application for online test i have to show the time remainig and update it accordingly and show that how much time is left for the paper
the admin gives the time limit in minutes
say he gives 60 minutes for the paper now when the paper starts it should shw the remaining time ,i have been pulling my hairs from hours and could not get it done , i am convertinng the current time to seconds the take the allowed mionutes and convert them to seconds and then add it up into the resultant of the current time this way i can get the futer time limit when the test is over but i want to show the time remaining in minutes like 59mins left 58 mins left i just want any one to help me out
i have an application for online test i have to show the time remainig and update it accordingly and show that how much time is left for the paper
the admin gives the time limit in minutes
say he gives 60 minutes for the paper now when the paper starts it should shw the remaining time ,i have been pulling my hairs from hours and could not get it done , i am convertinng the current time to seconds the take the allowed mionutes and convert them to seconds and then add it up into the resultant of the current time this way i can get the futer time limit when the test is over but i want to show the time remaining in minutes like 59mins left 58 mins left i just want any one to help me out
Code:
$time=date("h:i:s");
$t=split(":",$time);
$a=$t[0]*60;
$st=$a+$t[1];
$st=$st*60;
$st=$st+$a[2];
$given_time_seconds=60*60;
$limit=$st+$given_time_seconds;
$remaining_time=$limit-$st;
Comment