get Date Between Day - Android java.util

Android examples for java.util:Day

Description

get Date Between Day

Demo Code


//package com.java2s;

import java.util.Date;

public class Main {
    public static int getDateBetweenDay(Date fromDate, Date toDate) {
        long fromTime = fromDate.getTime();
        long toTime = toDate.getTime();
        long oneDay = 1000 * 60 * 60 * 24;
        long delta = (toTime - fromTime) / oneDay;

        return (int) delta;
    }/*from   www  .j  ava 2 s. co  m*/
}

Related Tutorials