/*
 * ObtenerDiasEntreFechas.java
 *
 * Created on 24 de marzo de 2007, 03:07 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.fidufosyga.rules.util;

import java.util.Date;

/**
 * 
 * @author Julian
 */
public class ObtenerDiasEntreFechas {

	/** Creates a new instance of ObtenerDiasEntreFechas */
	public static long calcular(Date d1, Date d2) {

		Date temp;
		if (d2.after(d1)) {
			temp = d1;
			d1 = d2;
			d2 = temp;
		}
		long dayDifference = ((d1.getTime()) / (24 * 3600 * 1000))
				- ((d2.getTime()) / (24 * 3600 * 1000));
		return dayDifference;
	}

}
