42 lines
949 B
PHP
42 lines
949 B
PHP
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<title>Compte à rebours :)</title>
|
|
<script src="jquery.js"></script>
|
|
</head>
|
|
|
|
<body style="background-color: violet;">
|
|
|
|
<div style="color: pink; font-size: 50px;"></div>
|
|
|
|
<SCRIPT LANGUAGE="JavaScript">
|
|
setInterval(function() {
|
|
Maintenant = new Date;
|
|
TempMaintenant = Maintenant.getTime();
|
|
Future = new Date(2013, 6, 10);
|
|
TempFuture = Future.getTime();
|
|
DiffSec = Math.floor((TempFuture-TempMaintenant)/1000);
|
|
DiffMin = Math.floor(DiffSec/60);
|
|
Diffheure = Math.floor(DiffMin/60);
|
|
DiffJour = Math.floor(Diffheure/24);
|
|
while (DiffMin>=60)
|
|
{
|
|
DiffMin = DiffMin-60;
|
|
}
|
|
while (Diffheure>=24)
|
|
{
|
|
Diffheure = Diffheure-24;
|
|
}
|
|
while (DiffSec>=60)
|
|
{
|
|
DiffSec = DiffSec-60;
|
|
}
|
|
$('div').replaceWith('<div style="color: pink; font-size: 50px;">Lyon : ' + DiffJour + ' jour(s), ' + Diffheure + ' heure(s), ' + DiffMin + ' minute(s) et ' + DiffSec + ' seconde(s)</div>');
|
|
}, 10);
|
|
</SCRIPT>
|
|
</body>
|
|
|
|
</html>
|