Java Timestamp Field getNbHours(Timestamp dateA, Timestamp dateB)

Here you can find the source of getNbHours(Timestamp dateA, Timestamp dateB)

Description

get Nb Hours

License

Open Source License

Declaration

public static int getNbHours(Timestamp dateA, Timestamp dateB) 

Method Source Code

//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
}

Related

  1. getMonthLastDay(Timestamp day)
  2. getMonthStart(java.sql.Timestamp stamp)
  3. getMonthStartTimestamp(Date date)
  4. getNanos(Timestamp timestamp)
  5. getNanoString(Timestamp timestamp, boolean full, char nanoSep)
  6. getNextDayStart(java.sql.Timestamp stamp)
  7. getNextTimestamp(Timestamp previous, long nrDays)
  8. getNotNullTimestampValue(String timestamp, String format)
  9. getNowTimestamp()