<div class="container-fluid site-content"><div class="card"><div class="card-body text-center auth-nav"
style="padding: 32px 0;border-top: 5px solid #00ff00;">
<div class="header-height-clone"></div>
<main class="container mb-auto mt-auto">
<div class="carousel carousel-main">
<div class="carousel-cell">
<h3 class="mt-3 main-header-text-title"><span>
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<h4>本站已安全運作</h4>
</div>
</div>
</div>
</div>
<span id="momk"></span>
<script language=javascript>
function show_date_time(){
window.setTimeout("show_date_time()", 1000);
BirthDay=new Date("02-12 10:10 2021");//建站日期
today=new Date();
timeold=(today.getTime()-BirthDay.getTime());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay
daysold=Math.floor(e_daysold);
e_hrsold=(daysold-e_daysold)*-24;
hrsold=Math.floor(e_hrsold);
e_minsold=(hrsold-e_hrsold)*-60;
minsold=Math.floor((hrsold-e_hrsold)*-60);
seconds=Math.floor((minsold-e_minsold)*-60);
momk.innerHTML=daysold+"天"+hrsold+"小時"+minsold+"分"+seconds+"秒" ;
}
show_date_time();
</script>
<style>
#momk{animation:change 10s infinite;font-weight:800; }
@keyframes change{0%{color:#5cb85c;}25%{color:#556bd8;}50%{color:#e40707;}75%{color:#66e616;}100% {color:#67bd31;}}
</style></span>
<div class="font-s12 push-20 clearfix">
<hr class="remove-margin-t">
<div style='text-align:center; padding:0px 0px 5px 0px;'>
</div>
</div>
</div>
</div>
将以上代碼加入進來,更改“//建站日期”标簽前括号裡内容為準确建站時間即可。
實作圖