between millisecond from two Dates - Android java.util

Android examples for java.util:Millisecond

Description

between millisecond from two Dates

Demo Code


//package com.java2s;

import java.util.Date;

public class Main {
    public static long betweenmillisecond(Date date1, Date date2) {
        long day2 = date2.getTime();
        long day1 = date1.getTime();
        long betweenseconds = Math.abs(day2 - day1);
        return betweenseconds;
    }/*from   ww  w . jav  a  2s.co m*/
}

Related Tutorials