
i need a code for time comparison in the basis of hour in java, based on grigorian calendar

import java.util.*;
public class TimeDifference {
public static void main(String[] av){
Date date = new GregorianCalendar(2010, 1, 1, 10, 00).getTime();
Date today = new Date();
long diff = today.getTime() - date.getTime();
long days=(diff / (1000 * 60 * 60 * 24));
System.out.println((days*24) + " hours.");
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.