-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart_timer.php
35 lines (26 loc) · 1008 Bytes
/
start_timer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
$start=$_SESSION['time_start'];
$ItemStartDate=$start."<br>";
$ItemEndDate = $end."<br>";
// $Today = time();
$TimeLeft = $ItemEndDate - $ItemStartDate;
//$TimeLeft = $ItemEndDate - $ItemStartDate;
if($TimeLeft > 0)
{
$ADayInSecs = 24 * 60 * 60;
$Days = $TimeLeft / $ADayInSecs;
$Days = intval($Days);
$TimeLeft = $TimeLeft - ($Days * $ADayInSecs);
$Hours = $TimeLeft / (60 * 60);
$Hours = intval($Hours);
$TimeLeft = $TimeLeft - ($Hours * 60 * 60);
$Minutes = $TimeLeft / 60;
$Minutes = intval($Minutes);
$TimeLeft = $TimeLeft - ($Minutes * 60);
echo "<span id='clock'>".$Minutes.':';
$Seconds = $TimeLeft;
$Seconds = intval($Seconds);
$TimeLeft = $TimeLeft - ($Seconds / 60 * 60 );
$MilliSeconds = $TimeLeft;
}
?>