Java Timestamp daysBetween(Timestamp t1, Timestamp t2)

Here you can find the source of daysBetween(Timestamp t1, Timestamp t2)

Description

days Between

License

Open Source License

Declaration

public static long daysBetween(Timestamp t1, Timestamp t2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.Timestamp;

public class Main {
    public static final long DAY_MILLI = 24 * 60 * 60 * 1000;

    public static long daysBetween(Timestamp t1, Timestamp t2) {
        return (t2.getTime() - t1.getTime()) / DAY_MILLI;
    }/* www. jav a 2s  .com*/
}

Related

  1. dateStringToTimestamp(String dateStr)
  2. datetime2ToTimestamp(long value, int fraction, int width)
  3. dateTimeToString(Timestamp dt, String df)
  4. dateToOracleStr(java.sql.Timestamp ts)
  5. dayNumber(Timestamp stamp)
  6. delta_hours(Timestamp startdate, Timestamp enddate)
  7. differDayByNow(Timestamp timestamp)
  8. doubleToTimestamp(double f)
  9. durationBetween(Timestamp startedAt, Timestamp completedAt)