Date and Time API


Joda-Time


Example
DateTime dateTime = new DateTime();
dateTime.toString("yyyy-MM-dd-HH-mm-ss"); 
// Result: 2010-05-13-11-06-01

Date date = dateTime.toDate();
Calendar cal = dateTime.toCalendar(loacle);

JSR-310


Comments