//YYYY 是表示:当天所在的周属于的年份,一周从周日开始,周六结束,只要本周跨年,那么这周就算入下一年。
//yyyyMMdd System.out.println("yyyyMMdd"); System.out.println("2019-12-28: " + df1.format(strDate1)); System.out.println("2019-12-29: " + df1.format(strDate2)); System.out.println("2019-12-31: " + df1.format(strDate3)); System.out.println("2020-01-01: " + df1.format(strDate4)); //YYYYMMdd System.out.println("YYYYMMdd"); System.out.println("2019-12-28: " + df2.format(strDate1)); System.out.println("2019-12-29: " + df2.format(strDate2)); System.out.println("2019-12-31: " + df2.format(strDate3)); System.out.println("2020-01-01: " + df2.format(strDate4));
标签:12,格式化,yyyyMMdd,format,System,2019,YYYYMMdd,println,out From: https://www.cnblogs.com/KL2016/p/16776214.html