Java Calendar Different dateDifferenceInMin(Calendar startDate, Calendar stopDate)

Here you can find the source of dateDifferenceInMin(Calendar startDate, Calendar stopDate)

Description

This method return the min as string between two dates.

License

Open Source License

Parameter

Parameter Description
startDate a parameter
stopDate a parameter

Declaration

public static String dateDifferenceInMin(Calendar startDate, Calendar stopDate) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {
    /**//from w ww . jav  a 2 s.  c  om
     * This method return the min as string between two dates.
     * @param startDate
     * @param stopDate
     * @return
     */
    public static String dateDifferenceInMin(Calendar startDate, Calendar stopDate) {
        return "" + ((stopDate.getTimeInMillis() - startDate.getTimeInMillis())) / (1000 * 60);
    }
}

Related

  1. datediff(Calendar c1, Calendar c2)
  2. dateDiff(int type, Calendar fromDate, Calendar toDate)
  3. dateDiff(int type, Calendar fromDate, Calendar toDate, boolean future)
  4. dateDiff(int type, Calendar fromDate, Calendar toDate, boolean future)
  5. dateDiff(long dateUtilitiesUnitField, Calendar firstDate, Calendar secondDate)
  6. diff(Calendar value1, Calendar value2, int millisInCondition)
  7. diffDay(Calendar calendar, int day)
  8. diffDays(Calendar startDate, Calendar endDate)
  9. differenceInDays(Calendar date1, Calendar date2)