1,593
社区成员
发帖
与我相关
我的任务
分享
function TfrmLogin.GetInternetTime: string;
begin
with TIdHTTP.Create(nil) do
begin
try
Result:=Get('https://www.czk667.top/time/GetDateTime.php');
except
Result:='';
end;
Free;
end;
end;
<html>
<link rel="shortcut icon" type="image/x-icon" href="/static/img/favicon/favicon_czk.ico"/>
<title>当前日期时间</title>
<script type="text/jscript" src="/js/jquery-3.2.1.min.js"></script>
<body bgcolor="#CCC">
<script type="text/javascript" >
function updata(){
$("#datetime").load("GetDateTime.php #datetime");
}
setInterval(updata, 1000);
</script>
<p id='datetime' class="datetime">
<?php
date_default_timezone_set("Asia/Beijing");
echo date('Y-m-d h:i:s');
?>
</p>
</body>
</html>