Java Date Difference timeDiff(Calendar date1, Calendar date2)

Here you can find the source of timeDiff(Calendar date1, Calendar date2)

Description

time Diff

License

Open Source License

Declaration

public static long timeDiff(Calendar date1, Calendar date2) 

Method Source Code

//package com.java2s;
/*//from   w w w.  j  av  a2 s. co m
 * OWN Server is 
 * Copyright (C) 2010-2012 Moreno Cattaneo <moreno.cattaneo@gmail.com>
 * 
 * This file is part of OWN Server.
 * 
 * OWN Server is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as 
 * published by the Free Software Foundation, either version 3 of the
 *  License, or (at your option) any later version.
 * 
 * OWN Server is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with OWN Server.  If not, see 
 * <http://www.gnu.org/licenses/>.
 */

import java.util.*;

public class Main {
    public static long timeDiff(Calendar date1, Calendar date2) {
        long diff = date1.getTimeInMillis() - date2.getTimeInMillis();

        return diff;
    }
}

Related

  1. getScoreDifferenceString(int newNumber, int oldNumber)
  2. getSecondDiff(Date d1, Date d2)
  3. getTimeDifferenceInSeconds(Date d, Date d2)
  4. nextSeconds(Date date, int diff)
  5. parseParamDate(final String diff)
  6. timeDiffHourMinSec(Date start, Date end)