看板java
标 题Re: [问题] 关於读取系统日期时间
发信站SayYA 资讯站 (Mon Dec 11 16:35:55 2006)
转信站ptt!ctu-reader!news.nctu!SayYa
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html
<%
Like other locale-sensitive classes, Calendar provides a class method,
getInstance, for getting a generally useful object of this type. Calendar's
getInstance method returns a Calendar object whose calendar fields have been
initialized with the current date and time:
Calendar rightNow = Calendar.getInstance();
%>
然後你可以取得Date物件
<%
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html#getTime()
Returns a Date object representing this Calendar's time value (millisecond
offset from the Epoch").
%>
接着把结果调成你想看到了样子
(线索来自於Date的toGMTString(),自己查阅一下)
http://java.sun.com/j2se/1.5.0/docs/api/java/text/DateFormat.html
--
※ Origin: SayYA 资讯站 <bbs.sayya.org>
◆ From: 163.26.34.248