Java Timestamp differDayByNow(Timestamp timestamp)

Here you can find the source of differDayByNow(Timestamp timestamp)

Description

differ Day By Now

License

Apache License

Declaration

public static int differDayByNow(Timestamp timestamp) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Timestamp;

public class Main {

    public static int differDayByNow(Timestamp timestamp) {
        return (int) (differMsByNow(timestamp) / 1000 / 60 / 60 / 24);
    }/*w  ww  . j ava  2s .c o m*/

    public static long differMsByNow(Timestamp timestamp) {
        long now = System.currentTimeMillis();
        long time = timestamp.getTime();
        long diff = now - time;
        return diff;
    }
}

Related

  1. dateTimeToString(Timestamp dt, String df)
  2. dateToOracleStr(java.sql.Timestamp ts)
  3. dayNumber(Timestamp stamp)
  4. daysBetween(Timestamp t1, Timestamp t2)
  5. delta_hours(Timestamp startdate, Timestamp enddate)
  6. doubleToTimestamp(double f)
  7. durationBetween(Timestamp startedAt, Timestamp completedAt)
  8. encodeTimestamp(Timestamp timestamp)
  9. endOfMonth(java.sql.Timestamp dd)