Return to Snippet

Revision: 19234
at October 19, 2009 05:54 by sendoa


Initial Code
function getNumeroDeNits(){
	var d1 = $('#datepicker1').val().split("-");
	var dat1 = new Date(d1[2], parseFloat(d1[1])-1, parseFloat(d1[0]));
	var d2 = $('#datepicker2').val().split("-");
	var dat2 = new Date(d2[2], parseFloat(d2[1])-1, parseFloat(d2[0]));

	var fin = dat2.getTime() - dat1.getTime();
	var dias = Math.floor(fin / (1000 * 60 * 60 * 24))  

	return dias;
}

Initial URL
http://blog.oridoki.com/2009/10/08/javascript-diferencia-entre-dos-fechas/

Initial Description

                                

Initial Title
Número de días entre dos fechas (JS)

Initial Tags

                                

Initial Language
JavaScript