Java Date Difference getSecondDiff(Date d1, Date d2)

Here you can find the source of getSecondDiff(Date d1, Date d2)

Description

get Second Diff

License

Open Source License

Declaration

static public long getSecondDiff(Date d1, Date d2) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {
    static public long getSecondDiff(Date d1, Date d2) {
        long d1t = d1.getTime();
        long d2t = d2.getTime();
        return (d2t - d1t) / 1000;
    }//from   w  ww. j av a2s.  c o m
}

Related

  1. getDifferenceInDays(Calendar calendar0, Calendar calendar1)
  2. getDiffMon(Date dt, int idiff)
  3. getDiffMon(Date dt, int idiff)
  4. getDiffToString(Date date, int n, String pattern)
  5. getScoreDifferenceString(int newNumber, int oldNumber)
  6. getTimeDifferenceInSeconds(Date d, Date d2)
  7. nextSeconds(Date date, int diff)
  8. parseParamDate(final String diff)
  9. timeDiff(Calendar date1, Calendar date2)