posts - 23, comments - 6, trackbacks - 0, articles - 0
            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          簡(jiǎn)單的顯示時(shí)間

          Posted on 2006-10-17 17:21 小傻 閱讀(271) 評(píng)論(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
          ??


          評(píng)論

          # re: 簡(jiǎn)單的顯示時(shí)間  回復(fù)  更多評(píng)論   

          2008-09-17 09:53 by JSP
          高手就是高手,代碼通俗易懂。真的很感謝你!!!
          主站蜘蛛池模板: 额敏县| 阿荣旗| 延津县| 高雄市| 贺州市| 霍林郭勒市| 宣化县| 黄骅市| 勃利县| 芦溪县| 金乡县| 营山县| 巴东县| 韶山市| 登封市| 马鞍山市| 庄河市| 西乌| 汕尾市| 和龙市| 轮台县| 佛冈县| 平泉县| 浠水县| 维西| 名山县| 沛县| 资源县| 景宁| 迁西县| 兴山县| 紫阳县| 广宗县| 涟水县| 潜江市| 韶关市| 淅川县| 米泉市| 志丹县| 师宗县| 龙川县|