Posted By

agarcim on 02/21/13


Tagged

javascript dates operations


Versions (?)

Difference in days between two dates


 / Published in: JavaScript
 

Returns the differencia in days between tw dates

  1. //Diferencia en días entre dos fechas
  2. Date.difDias(fecha1,fecha2) {
  3. return Math.ceil(Math.abs((fecha1.getTime() - fecha2.getTime())/(24*60*60*1000)));
  4. };

Report this snippet  

You need to login to post a comment.