zoukankan      html  css  js  c++  java
  • 给定一个年月!获取每月每天所对应的星期

    public class Test030 {
        public static void main(String[] args){
            String s = "2013/9";
            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd");
            sdf1.setLenient(false);
            SimpleDateFormat sdf2 = new SimpleDateFormat("EEE");
            for(int i = 1; i < 32; i++){
                try {
                    Date date = sdf1.parse(s + "/" + i);
                    System.out.println(sdf1.format(date) + " : " + sdf2.format(date));
                } catch (ParseException e) {
                    //do nothing
                }
            }
                                   
        }

            

  • 相关阅读:
    Hello World
    函数
    js基础
    html
    npm
    数据库
    前端了解的简要php
    模块
    scrapy爬虫
    php升级代码检查
  • 原文地址:https://www.cnblogs.com/shiguotao-com/p/4624008.html
Copyright © 2011-2022 走看看