Calendar cl = Calendar.getInstance(); int nowMonth = cl.get(Calendar.MONTH); // 0 int nowMonth2 = cl.get(Calendar.MONTH - 1); // 2017? In January, nowMonth is 0 , good.
Why nowMonth2 - 2017 ? Those. returns year.
Source: https://ru.stackoverflow.com/questions/611857/
All Articles