Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

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

public class Main {
    public static long getDiffOfMillis(Date starDate, Date endDate) {
        Calendar star = Calendar.getInstance();
        star.setTime(starDate);
        Calendar end = Calendar.getInstance();
        end.setTime(endDate);
        long diff = star.getTimeInMillis() - end.getTimeInMillis();
        long diffMillis = (Math.abs(diff));
        return diffMillis;
    }
}