Java Timestamp isLongTerm(Timestamp oldTime, Timestamp newTime)

Here you can find the source of isLongTerm(Timestamp oldTime, Timestamp newTime)

Description

is Long Term

License

Open Source License

Declaration

public static boolean isLongTerm(Timestamp oldTime, Timestamp newTime) 

Method Source Code


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

import java.sql.Timestamp;

public class Main {
    public static boolean isLongTerm(Timestamp oldTime, Timestamp newTime) {
        long delta = Math.abs(newTime.getTime() - oldTime.getTime());
        int days = (int) (delta / (1000 * 60 * 60 * 24));
        //      System.out.println("Days: " + days);
        if (days >= 365) {
            //         System.out.println("long...");
            return true;
        }//  ww w . j a va2  s . c o  m
        //      System.out.println("short...");
        return false;
    }
}

Related

  1. isAllDay(Timestamp start, Timestamp end)
  2. isDifferentDay(final Timestamp ts1, final Timestamp ts2)
  3. isDST(Timestamp ts)
  4. isInPast(Timestamp timeStamp)
  5. isLongDate(Timestamp date)
  6. isSameDay(Timestamp one, Timestamp two)
  7. isSameMonth(Timestamp t1, Timestamp t2)
  8. IsTechStatisticWorkTime(Timestamp timestamp)
  9. isTimeStamp(Class o)