What's the difference between adding DAY_OF_MONTH or DAY_OF_YEAR to a Calendar object?

前端 未结 10 1374
星月不相逢
星月不相逢 2020-12-08 01:42

I want to increase a certain date by 1 day. I create a Calendar object like:

Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, 2012);
cal.set(Cal         


        
10条回答
  •  猫巷女王i
    2020-12-08 02:38

    Use Calendar.DATE for your purposes. In your case these three constants are synonyms.

提交回复
热议问题