Java Day End getMinllisBetween(Date beginDate, Date endDate)

Here you can find the source of getMinllisBetween(Date beginDate, Date endDate)

Description

get Minllis Between

License

Open Source License

Declaration

public static long getMinllisBetween(Date beginDate, Date endDate) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main {

    public static long getMinllisBetween(Date beginDate, Date endDate) {
        Calendar d1 = new GregorianCalendar();
        d1.setTime(beginDate);//  w  ww .  ja va  2s .c om
        Calendar d2 = new GregorianCalendar();
        d2.setTime(endDate);

        if (d1.after(d2)) {
            return 0;
        }

        long minllis = d2.getTimeInMillis() - d1.getTimeInMillis();
        return minllis;
    }
}

Related

  1. getEndSixMonthly(Date startDate)
  2. getEndTimeOfDay(Date date)
  3. getEndTimeOfDayOrNow(Date date)
  4. getKalenderWoche(final Date date, final Locale locale)
  5. getLastDayEnding(Date date, int field)
  6. getMondays(Date startDate, Date endDate)
  7. getMonthBetween(Date startDate, Date endDate)
  8. getMonthCha(Date start, Date end)
  9. getMonthCount(Date startDate, Date endDate)