zoukankan      html  css  js  c++  java
  • GregorianCalendar类的使用

    Calendar与GregorianCalendar是父子关系,Calendar是父类.

    Calendar日历类

    GregorianCalendar类用法 对日期的年月日等进行加减

    public class GregorianCalendarTest {
    	public static void main(String[] args) {
    		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    		GregorianCalendar cal = new GregorianCalendar();
    		Date date = new Date();
    		System.out.println(sdf.format(date));
    		cal.setTime(date);
    		cal.add(1, 1);
    		Date time = cal.getTime();
    		System.out.println(sdf.format(time));
    	}
    }
    
    2019-12-06
    2020-12-06
    
    public final static int YEAR = 1;
    public final static int MONTH = 2;
    public final static int WEEK_OF_YEAR = 3;
    public final static int WEEK_OF_MONTH = 4;
    public final static int DATE = 5;
    public final static int DAY_OF_MONTH = 5;
    public final static int DAY_OF_YEAR = 6;
    public final static int DAY_OF_WEEK = 7;
    public final static int DAY_OF_WEEK_IN_MONTH = 8;
    public final static int AM_PM = 9;
    public final static int HOUR = 10;
    public final static int HOUR_OF_DAY = 11;
    public final static int MINUTE = 12;
    public final static int SECOND = 13;
    public final static int MILLISECOND = 14;
    public final static int ZONE_OFFSET = 15;
    。。。。。
    Calendar
    
  • 相关阅读:
    攻防世界-web进阶-Web_php_include
    攻防世界-web进阶-php_rce
    Buuctf-misc-穿越时空的思念
    Buuctf-misc-[BJDCTF 2nd]EasyBaBa (kinovea)
    Buuctf-misc-菜刀666
    Buuctf-misc-[BJDCTF 2nd]圣火昭昭-y1ng(outguess)
    Access数据库简介
    VC与VB
    VB的使用
    工作总结2
  • 原文地址:https://www.cnblogs.com/sm1128/p/11994452.html
Copyright © 2011-2022 走看看