Here you can find the source of dateDiffInDays(Date dateStart, Date dateEnd)
Parameter | Description |
---|---|
dateStart | the beginning of the intervalle |
dateEnd | the end of the inervalle |
public static float dateDiffInDays(Date dateStart, Date dateEnd)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static final long ONE_DAY_IN_MILLIS = 60 * 60 * 24 * 1000; /**/*from w ww. ja v a 2 s . co m*/ * computes (dateEnd - dateStart) in days * @param dateStart the beginning of the intervalle * @param dateEnd the end of the inervalle * @return the length of the intervalle in days */ public static float dateDiffInDays(Date dateStart, Date dateEnd) { return ((float) (dateEnd.getTime() - dateStart.getTime())) / ONE_DAY_IN_MILLIS; } }