currently i am using calendar type..
GregorianCalendar gcalendar = new GregorianCalendar();
// Display current time and date information.
System.out.print("Date: ");
System.out.print(gcalendar.get(Calendar.MONTH)+1);
//System.out.print(Calendar.MONTH);
System.out.print(" " + gcalendar.get(Calendar.DATE) + " ");
System.out.println(year = gcalendar.get(Calendar.YEAR));
System.out.print("Time: ");
System.out.print(gcalendar.get(Calendar.HOUR_OF_DAY) + ":");
//System.out.print(Calendar.HOUR + ":");
System.out.print(gcalendar.get(Calendar.MINUTE) + ":");
System.out.println(gcalendar.get(Calendar.SECOND));
i want to use joda timing ... what should i do..
You haven't stated in which case you would use the Joda-Time library, but the basics are stated in the website.
Here you can refer also to how to use the Joda-Time
Chronology
, one of the key concepts behind the library (which I highly recommend to read to grasp the basics). Here down a sample using the Gregorian calendar: