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
討論串 (同標題文章)
完整討論串 (本文為第 2 之 3 篇):