- {pc:get sql="SELECT begintime FROM kj_meeting_data where id='$id'}
- {loop $data $v}
- <p id="times"></p>
- <SCRIPT LANGUAGE="JavaScript">
- function _fresh()
- {
- var endtime=new Date("<?php echo(''.date('Y/m/d,h:i:s',$v['begintime']).''); ?>");//格式 2014/12/26,08:50:00
- var nowtime = new Date();
- var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
- __d=parseInt(leftsecond/3600/24);
- __h=parseInt((leftsecond/3600)%24);
- __m=parseInt((leftsecond/60)%60);
- __s=parseInt(leftsecond%60);
- document.getElementById("times").innerHTML="距离会议开启还有"+__d+"天 "+__h+"小时"+__m+"分"+__s+"秒";
- if(leftsecond<=0){
- document.getElementById("times").innerHTML="<a href='#'>进入会场</a>";
- clearInterval(sh);
- }
- }
- _fresh()
- var sh;
- sh=setInterval(_fresh,1000);
- </SCRIPT>
- {/loop}
- {/pc}
phpcms 调取时间 倒计时