Here you can find the source of millisBetween(Date firstDate, Date lastDate)
Parameter | Description |
---|---|
firstDate | Data inicial |
lastDate | Data final |
public static long millisBetween(Date firstDate, Date lastDate)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**/* w ww . j a v a 2 s.c om*/ * Retorna o número de milissegundos entre dias dadas * @param firstDate Data inicial * @param lastDate Data final * @return Número de milissegundos */ public static long millisBetween(Date firstDate, Date lastDate) { long t1 = firstDate.getTime(); long t2 = lastDate.getTime(); long dif = t1 - t2; if (dif < 0) { dif = dif * (-1); } return dif; } }