time.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
<div id="hh"></div>
<script type="text/javascript">
function gett(){
$(function(){
$.ajax({
url:'time.php',
type:"POST",
data:{action:"guesslike"},
dataType:"html",
timeout:3000,
cache:false,
success:function(re){
$('#hh').html(re);
}
})
});
setTimeout("gett()",1000)
}
gett();
</script>
</body>
</html>
time.php
<?php
date_default_timezone_set('Asia/Shanghai');
$time=time();
$h=23-date('H',$time);
$m=59-date('i',$time);
$s=60-date('s',$time);
echo '当前时间:'.date("Y-m-d H:i:s" ,$time)."剩余时间".$h.":".$m.":".$s ;
?>