Calendar Class problems

前端 未结 6 667
梦谈多话
梦谈多话 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:58

    Month in Calendar begins at 0, which means 0 is January, 1 is February, etc.

    Java Date and Time API sucks. Use Joda-Time instead.

提交回复
热议问题