Home > Web Front-end > HTML Tutorial > 新人求教,html问题,显示网页时间_html/css_WEB-ITnose

新人求教,html问题,显示网页时间_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 08:54:46
Original
1242 people have browsed it




Date theDate=new Date();
Date getDate()
{
System.out.println("In getDate() method");
return theDate;
}
%>
Hello! The time is now 

 
不管怎么重载网页,日期都是相同的,书上说增加函数computeDate重新初始化theDate,并增加Scriptet调用computeDate,但怎么加呢 求教


回复讨论(解决方案)

你把书上的东西贴出来,不然谁能帮你。。。

书上就这么多啊  它说自己改啊 书上有的话我还会问嘛

<script> <br />var d = new Date() <br />var vYear = d.getFullYear() <br />var vMon = d.getMonth() + 1 <br />var vDay = d.getDate() <br />var h = d.getHours(); <br />var m = d.getMinutes(); <br />var se = d.getSeconds(); <br />s=vYear+(vMon<10 ? "0" +'-'+ vMon : vMon)+'-'+(vDay<10 ? "0"+ vDay : vDay)+' '+(h<10 ? "0"+ h : h)+':'+(m<10 ? "0" + m : m)+':'+(se<10 ? "0" +se : se); <br />alert(s); <br /></script>

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template