Java Date Difference diffDay(Date startDate, Date endDate)

Here you can find the source of diffDay(Date startDate, Date endDate)

Description

Returns the number of days difference between two dates DUPLICATE METHOD?

License

Apache License

Return

Number of days difference

Declaration

public static int diffDay(Date startDate, Date endDate) 

Method Source Code

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

import java.util.*;

public class Main {
    /**//from  w  w  w  . j av  a2s.  c o  m
     * Returns the number of days difference between two dates
     * DUPLICATE METHOD?
     *
     * @return Number of days difference
     */
    public static int diffDay(Date startDate, Date endDate) {
        if (startDate == null || endDate == null) {
            return 0;
        }
        return (int) ((endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24));
    }
}

Related

  1. diffDateM(Date sd, Date ed)
  2. diffDates(long starttime, long endtime, int type)
  3. diffDateSec(java.util.Date date, java.util.Date date1)
  4. diffDay(Date date1, Date date2)
  5. diffDay(Date start, Date end)
  6. differDays(Date src, Date target)
  7. difference(Date date1, Date date2)
  8. differenceDay(Date toDate, Date fromDate)
  9. DifferenceInMilliseconds(Date date1, Date date2)