Android Date Interval Get hoursBetweenDate(Date date1, Date date2)

Here you can find the source of hoursBetweenDate(Date date1, Date date2)

Description

hours Between Date

Declaration

public static long hoursBetweenDate(Date date1, Date date2) 

Method Source Code

//package com.java2s;

import java.util.Date;

public class Main {
    public static long hoursBetweenDate(Date date1, Date date2) {
        long d = date1.getTime() - date2.getTime();
        return d / 3600000;
    }//from w w  w .j a v  a 2 s .c o  m
}

Related

  1. getIntervalDays(Date minDate, Date maxDate)
  2. getIntervalDays(String sd, String ed)
  3. getIntervalHours(Date minDate, Date maxDate)
  4. getIntervalMinutes(Date minDate, Date maxDate)
  5. getIntervalYears(Date date1, Date date2)
  6. millisecondsBetween(Date dt1, Date dt2)
  7. millisecondsBetween(Date dt1, Date dt2)
  8. minuteBetweenDate(Date date1, Date date2)
  9. minutesBetween(Date dt1, Date dt2)