?Date dd=new Date();
?String adddate=dd.toLocaleString();
Calendar ? rightNow ? = ? Calendar.getInstance(); ?
? out.println(rightNow.getTime());
Calendar ? now ? = ? new ? GregorianCalendar(); ?
? System.out.println(now.get(Calendar.YEAR)); ? //year ?
? System.out.println(now.get(Calendar.MONTH) ? + ? 1);//month ?
? System.out.println(now.get(Calendar.DAY_OF_MONTH)); ? //day ?
? System.out.println(now.get(Calendar.HOUR_OF_DAY)); ? //hour ?
? System.out.println(now.get(Calendar.MINUTE)); ? //minute ?
? System.out.println(now.get(Calendar.SECOND)); ? //second ?
? System.out.println(now.get(Calendar.MILLISECOND)); ? //ms??
評(píng)論
# re: 簡(jiǎn)單的顯示時(shí)間 回復(fù) 更多評(píng)論
2008-09-17 09:53 by JSP高手就是高手,代碼通俗易懂。真的很感謝你!!!
只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。 | ||
![]() |
||
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問(wèn)
管理
|
||
相關(guān)文章:
|
||