Re: [問題] 關於讀取系統日期時間

看板java作者時間19年前 (2006/12/11 17:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
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
文章代碼(AID): #15VHvG00 (java)
文章代碼(AID): #15VHvG00 (java)