Java Date Compare compareDate(Date start, Date end)

Here you can find the source of compareDate(Date start, Date end)

Description

compare Date

License

Apache License

Declaration

public static long compareDate(Date start, Date end) 

Method Source Code

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

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

public class Main {

    public static long compareDate(Date start, Date end) {
        long temp = 0;
        Calendar starts = Calendar.getInstance();
        Calendar ends = Calendar.getInstance();
        starts.setTime(start);/*from w w w  .  j  av a2  s  .c o  m*/
        ends.setTime(end);
        temp = ends.getTime().getTime() - starts.getTime().getTime();
        return temp;
    }
}

Related

  1. compareDate(Date date1, Date date2)
  2. compareDate(Date date1, Date date2)
  3. compareDate(Date date1, Date date2, String pattern)
  4. compareDate(Date first, Date second)
  5. compareDate(Date sourceDate, Date targetDate)
  6. compareDate(String begingDate, String endDate, String format)
  7. compareDate(String d1, String d2)
  8. compareDate(String d1, String d2)
  9. compareDate(String date)