隨筆 - 24  文章 - 0  trackbacks - 0
          <2011年12月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          常用鏈接

          留言簿

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          public class Test {

           /**
            * @param args
            * @throws java.text.ParseException
            */

           public static void main(String[] args) throws java.text.ParseException {
            // Date dateNow = new Date();
            //
            // String dateNowStr = dateFormat.format(dateNow);
            // System.out.println(dateNowStr);

            final String dayNames[] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五",
              "星期六" };
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");

            Calendar calendar = Calendar.getInstance();
            Date date = new Date();
            String datarq = dateFormat.format(date); //日期
            
            calendar.setTime(date);
            int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK) - 1;
            if (dayOfWeek < 0)
             dayOfWeek = 0;

            System.out.println(datarq + "  " + dayNames[dayOfWeek]);

           }

          }

          posted on 2011-12-22 15:07 馮占科 閱讀(145) 評論(0)  編輯  收藏

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 芮城县| 进贤县| 宕昌县| 大冶市| 通渭县| 宁城县| 夏河县| 双牌县| 翁牛特旗| 宣汉县| 朝阳县| 思茅市| 陈巴尔虎旗| 嘉善县| 花莲市| 秦皇岛市| 开平市| 茂名市| 来凤县| 竹山县| 阳山县| 临邑县| 海丰县| 蓬溪县| 邵东县| 铅山县| 柳州市| 南汇区| 韩城市| 宣恩县| 二手房| 苍溪县| 石狮市| 卓尼县| 利辛县| 顺义区| 永城市| 渝中区| 县级市| 桑日县| 靖宇县|