posts - 33,  comments - 17,  trackbacks - 0
           public static boolean checkDate(String str) {
            boolean bolRet = true;
            if (StringUtils.isNotEmpty(str)) {
             try {
              SimpleDateFormat formatDate = new SimpleDateFormat("yyyy/MM/dd");
              //    將某個日期以固定格式轉(zhuǎn)化成字符串
             //    String str = sdf.format(formatDate );
              formatDate.setLenient(false);
              Calendar calendar = Calendar.getInstance();
              java.util.Date date = formatDate.parse(str);
              calendar.setTime(date);
              int nowYear = calendar.get(Calendar.YEAR);
              bolRet = (nowYear >= 2000) && (nowYear <= 9999)
                && formatDate.format(date).equals(str);
             } catch (Exception ex) {
              bolRet = false;
              System.out.println(ex);
             }
            }
            return bolRet;
           }
          posted on 2008-05-23 15:53 scea2009 閱讀(171) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          <2008年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          PL/SQL存儲過程與函數(shù)

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 柯坪县| 泾川县| 东至县| 五峰| 托克逊县| 北票市| 荆州市| 金华市| 奎屯市| 阜宁县| 合作市| 安吉县| 龙山县| 扶绥县| 改则县| 开江县| 海口市| 凤凰县| 临桂县| 星子县| 湖南省| 连城县| 上杭县| 和田市| 蒙山县| 清徐县| 荃湾区| 樟树市| 玉环县| 阳东县| 平山县| 钟祥市| 洪洞县| 义马市| 鄂尔多斯市| 舞钢市| 东明县| 海阳市| 荣昌县| 永宁县| 交口县|