Organise number of days into separate sections for year, months, days, hours. Java
is there a way of organising a number of days calculated by working out the difference between two dates, into different sections e.g. for 364 days it would be: 0 years, 11 months, 30 days, hours, minutes etc. I thought using logical operators may work like % and / but as different months have different amounts of days and some years are leap years i'm not sure how to do it. Any help would be much appreciated. My code: import java.util.*; public class CleanDate { public static void main(String[] args) { Calendar cDate = GregorianCalendar.getInstance(); cDate.set(2011, 0, 31, 00, 00, 00); Date