time is 00:00:00
time is 00:00:10
time is 00:00:20
time is 00:00:30
time is 00:00:40
time is 00:00:50
time is 00:1:00 <---another issue
time is 00:00:70
time is 00:00:80
time is 00:00:90
printf("%02d",$minutes)
i=1;
while($i<=$ts) {
$num = '000';
$sequence = $num + $i;
if ($sequence == "1") {
$ss = "00:00:00";
echo " time is $ss";
} else {
$one = "1"; // need to take away from sequence used above
$minutez= "00";
$secondz= "00";
$hourz = "00";
$seq = $sequence-$one;
$ten ="10";
$seq = $seq*$ten;
$zeros ="00";
$secondz = $zeros + $seq;
if ($secondz == "60"){
$secondz=$zeros;
if ($minutez < 10){
$minz = "0$minutez";
} else{
$minz = "$minutez";
}
$minutez = $minz + $one;
}
$ss = "$hourz:$minutez:$secondz";
echo "time is $ss<br />";
} // closes if statement
$i++;
} // closes while loop
function secondsToTime($seconds) {
$s = $seconds%60;
$m = floor($seconds/60)%60;
$h = floor($seconds/60/60);
return sprintf("%02d:%02d:%02d",$h,$m,$s);
}
for($seconds=0;$seconds<=500;$seconds+=10) {
echo secondsToTime($seconds)."<br>";
}
$i=1;
while($i<=$ts) {
$num = '000';
$sequence = $num + $i;
if ($sequence == "1") {
$ss = "00:00:00";
echo "time is $ss <br />";
} else {
$one = "1"; // need to take away from sequence used above
$seq = $sequence-$one;
$ten ="10";
$seq = $seq*$ten;
// get duration and start time
$hourz = intval(intval($seq) / 3600);
if ($hourz < 10){
$hr = "0$hourz";
} else {
$hr = "$hourz";
}
$minutez = intval(((intval($seq) / 60) % 60));
if ($minutez < 10){
$minz = "0$minutez";
} else{
$minz = "$minutez";
}
$secondz = intval(intval(($seq % 60)));
if ($secondz < 10){
$secz = "0$secondz";
} else {
$secz = "$secondz";
}
$ss = "$hr:$minz:$secz";
echo "time is $ss <br />";
time is 00:00:00
time is 00:00:10
time is 00:00:20
time is 00:00:30
time is 00:00:40
time is 00:00:50
time is 00:01:00
time is 00:01:10
time is 00:01:20
while($i<=$ts) {
$sequence = $i;
if ($sequence == "1") {
$ss = "00:00:00";
echo "time is $ss <br />";
} else {
$one = "1"; // need to take away from sequence used above
$seq = $sequence-$one;
...
while($i<=$ts) {
$sequence = $i - 1; //take away one
...
$hourz = intval(intval($seq) / 3600);
$minutez = intval(((intval($seq) / 60) % 60));
$secondz = intval(intval(($seq % 60)));
$s = $seconds%60;
$m = floor($seconds/60)%60;
$h = floor($seconds/60/60);
$i=1;
while($i<=$ts) {
$sequence = $i;
$seq = $sequence-1; //need to remove 1 from your comments
$seq = $seq*10;
// get duration and start time
$hourz = intval($seq / 3600);
if ($hourz < 10){
$hourz = "0$hourz";
}
$minutez = intval($seq / 60) % 60;
if ($minutez < 10){
$minutez = "0$minutez";
}
$secondz = $seq%60;
if ($secondz < 10){
$secondz = "0$secondz";
}
$ss = "$hourz:$minutez :$secondz ";
echo "time is $ss <br />";
}
$hourz = intval($seq / 3600);
if ($hourz < 10){
$hourz = "0$hourz";
}
$minutez = intval($seq / 60) % 60;
if ($minutez < 10){
$minutez = "0$minutez";
}
$secondz = $seq%60;
if ($secondz < 10){
$secondz = "0$secondz";
}
$ss = "$hourz:$minutez :$secondz ";
$s = $seconds%60;
$m = floor($seconds/60)%60;
$h = floor($seconds/60/60);
$ss = sprintf("%02d:%02d:%02d",$h,$m,$s);
$s = $interval % 60;
$m = ($interval / 60) % 60;
$h = ($interval / 60 / 60) % 24;
$d = ($interval / 60 / 60 / 24);
print "{$d}d {$h}h {$m}m {$s}s\n";