posts - 23, comments - 6, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          簡單的顯示時間

          Posted on 2006-10-17 17:21 小傻 閱讀(267) 評論(1)  編輯  收藏 所屬分類: jsp

          ?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
          ??


          評論

          # re: 簡單的顯示時間  回復  更多評論   

          2008-09-17 09:53 by JSP
          高手就是高手,代碼通俗易懂。真的很感謝你!!!
          主站蜘蛛池模板: 荆州市| 青河县| 丰都县| 海丰县| 长岛县| 澄迈县| 东丰县| 太康县| 天祝| 安塞县| 耿马| 东方市| 江永县| 舞阳县| 慈溪市| 公主岭市| 颍上县| 固阳县| 祥云县| 宁都县| 临泽县| 高州市| 白城市| 芦山县| 时尚| 原阳县| 兴仁县| 平乡县| 惠安县| 荥阳市| 塘沽区| 西乌珠穆沁旗| 和政县| 通州区| 疏勒县| 满城县| 昂仁县| 册亨县| 应城市| 东港市| 刚察县|