Java tutorial
//package com.java2s; import java.sql.Date; public class Main { public static int getElapsedTimeInHours(Date start, Date end) { int hours = (int) (start.getTime() - end.getTime()) / (1000 * 60 * 60); return hours; } }