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
          高手就是高手,代碼通俗易懂。真的很感謝你!!!
          主站蜘蛛池模板: 黔西| 乐都县| 德钦县| 渭南市| 玉山县| 同心县| 拉萨市| 库伦旗| 西乌珠穆沁旗| 三亚市| 怀集县| 澄迈县| 水富县| 原阳县| 汽车| 陕西省| 巨野县| 石台县| 云林县| 临邑县| 张家川| 武陟县| 凤翔县| 北川| 建德市| 新田县| 高阳县| 安吉县| 邯郸市| 南京市| 安宁市| 民丰县| 西乌| 旅游| 吕梁市| 乐山市| 玛纳斯县| 沧源| 大安市| 缙云县| 内黄县|