Here you can find the source of getNbHours(Timestamp dateA, Timestamp dateB)
public static int getNbHours(Timestamp dateA, Timestamp dateB)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; public class Main { public static int getNbHours(Timestamp dateA, Timestamp dateB) { return (int) ((dateB.getTime() - dateA.getTime()) / 3600000); }// w w w .j a va 2 s . c o m }