隨筆 - 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 @ 2011-12-22 15:07 馮占科 閱讀(148) | 評論 (0)編輯 收藏
          主站蜘蛛池模板: 临高县| 余庆县| 舟曲县| 花垣县| 东兴市| 潍坊市| 甘德县| 明水县| 长垣县| 三江| 河西区| 宁国市| 韶山市| 剑阁县| 松潘县| 南溪县| 那坡县| 论坛| 长武县| 修文县| 蕉岭县| 广丰县| 锡林郭勒盟| 潍坊市| 武宁县| 正蓝旗| 贵南县| 蓝田县| 平邑县| 白沙| 永春县| 沾益县| 辽宁省| 昆明市| 沽源县| 青州市| 北流市| 稻城县| 鲁甸县| 福建省| 即墨市|