Java Timestamp Field getDiffYear(java.sql.Timestamp start, java.sql.Timestamp end)

Here you can find the source of getDiffYear(java.sql.Timestamp start, java.sql.Timestamp end)

Description

Gets the diff year.

License

Apache License

Parameter

Parameter Description
start the start
end the end

Return

the diff year

Declaration

public static int getDiffYear(java.sql.Timestamp start, java.sql.Timestamp end) 

Method Source Code

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

public class Main {
    /**//  w w  w .  j av  a2  s  . c  o m
     * Gets the diff year.
     *
     * @param start the start
     * @param end   the end
     * @return the diff year
     */
    public static int getDiffYear(java.sql.Timestamp start, java.sql.Timestamp end) {
        return end.getYear() - start.getYear();
    }
}

Related

  1. getDefaultTimestamp()
  2. getDiffDay(Timestamp time1, Timestamp time2)
  3. getDifferenceInHours(Timestamp startDateTime, Timestamp endDateTime)
  4. getDiffSecond(long orgTimestamp, long desTimestamp)
  5. getDiffTime(Timestamp last)
  6. getDiscrepancyNum(Timestamp time1, Timestamp time2)
  7. getDouble(Timestamp ts)
  8. getDuration(final Timestamp start, final Date end)
  9. getDurationHour(Timestamp time1, Timestamp time2, String direction)