Total time help
Posted: Fri Feb 29, 2008 5:21 pm
Mod | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
ok so heres what im doing now... sorry i post with so much help needed.. i just suck
ne way im making a clock in system and i have everything good except for one thing.. thats right i am having problems with total times
so lets say i clocked in at
1:05:00 pm
and clocked out at
2:00:00 pm
so i worked for 55 mins
the system i made for it isnt complete cause it would just parse out
-5 Min instead of 55 M ... here is my code
Mod | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
ok so heres what im doing now... sorry i post with so much help needed.. i just suck
ne way im making a clock in system and i have everything good except for one thing.. thats right i am having problems with total times
so lets say i clocked in at
1:05:00 pm
and clocked out at
2:00:00 pm
so i worked for 55 mins
the system i made for it isnt complete cause it would just parse out
-5 Min instead of 55 M ... here is my code
Code: Select all
<?php
///////////// It runs out of my database --- So i use explodes and i use 24 hour times
$explodeS = explode(":", $row['fullTimeS']);
$explodeF = explode(":", $row['fullTimeF']);
if($explodeF[0] - $explodeS[0]==0){
$first = "";
}else{
$first = $explodeF[0] - $explodeS[0]."<b>H</b> ";
}
if($explodeF[1] - $explodeS[1]==0){
$second = "";
}else{
$second = $explodeF[1] - $explodeS[1]."<b>M</b> ";
}
if($explodeF[2] - $explodeS[2]==0){
$third = "";
}else{
$third = $explodeF[2] - $explodeS[2]."<b>S</b> ";
}
echo $first.$second.$third;
?>
Mod | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: