得到某一天是星期幾

          //獲取yyyy-MM-dd是星期幾
          public static int getWeekdayOfDateTime(String datetime){
             DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
             Calendar c = Calendar.getInstance();  
                try {
            c.setTime(df.parse(datetime));
             } catch (Exception e) {
            e.printStackTrace();
             }
             int weekday = c.get(Calendar.DAY_OF_WEEK)-1;
             return weekday;
          }

          posted on 2007-06-26 13:25 付軒 閱讀(2636) 評論(0)  編輯  收藏


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


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          <2007年6月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          導航

          統計

          常用鏈接

          留言簿(2)

          隨筆檔案

          相冊

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 和硕县| 北票市| 芜湖县| 阳谷县| 河北省| 武夷山市| 临沧市| 丘北县| 洪雅县| 万宁市| 信阳市| 奉化市| 乌苏市| 崇阳县| 博野县| 镇原县| 北宁市| 新津县| 山丹县| 新乡市| 沾益县| 博湖县| 图们市| 合作市| 顺义区| 大庆市| 四川省| 甘泉县| 贵德县| 滦南县| 乌苏市| 西藏| 潞西市| 甘泉县| 儋州市| 鹤山市| 大丰市| 拜城县| 雷波县| 肥西县| 原平市|