<script type="text/javascript"> var urodz= new Date("August 9,2018"); var s = "2008北京奥运会"; var now = new Date(); var ile = urodz.getTime() - now.getTime(); var dni = Math.floor(ile / (1000 * 60 * 60 * 24)); if (dni > 1) document.write("今天离"+s+"还有"+dni +"天") else if (dni == 1) document.write("只有2天啦!") else if (dni == 0) document.write("只有1天啦!") else document.write("期待奥运会再次来到中国!"); </script>