Calendar Class problems

前端 未结 6 698
梦谈多话
梦谈多话 2021-01-24 02:32

I am having problems with the Calendar Class.

Calendar cal = Calendar.getInstance ();

int iYear  = cal.get (Calendar.YEAR);         // get the curr         


        
6条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-24 02:41

    use constants in Calendar for month: Calendar.JANUARY etc

    For example:

    cal.set(2014, Calendar.FEBRUARY, 27);
    

提交回复
热议问题