Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Date;

import java.util.concurrent.TimeUnit;

public class Main {
    public static int diffDate(Date fromDay, Date toDay) {

        long from = fromDay.getTime();
        long to = toDay.getTime();
        return (int) TimeUnit.MILLISECONDS.toDays(to - from);
    }
}