Long-type turn into Calendar, and obtain operational date

A, Long type turn into Calendar

Calendar endCalendar=Calendar.getInstance();
endCalendar.setTimeInMillis(endTime);

Second, the acquisition date information Calendar

年:endCalendar.get(Calendar.YEAR)
月:endCalendar.get(Calendar.MONTH)
日:endCalendar.get(Calendar.DAY_OF_MONTH)

The same type Date Calendar that is one more step to turn the first into Long to Date

Long time = new Date().getTime();

 

Published 98 original articles · won praise 9 · views 50000 +

Guess you like

Origin blog.csdn.net/liucai1018/article/details/101014886