Salsomaggiore Terme (Programmazione) - 04/12/2020 - - Written by
JavaScript number days between two dates
How do I get the number of days between two dates in JavaScript?

Here is a quick and dirty implementation of datediff, as a proof of concept to solve the problem as presented in the question. It relies on the fact that you can get the elapsed milliseconds between two dates by subtracting them, which coerces them into their primitive number value (milliseconds since the start of 1970

var days = Math.round((data1-data2)/(1000*60*60*24));

Fonte stackoverflow.com

Altri articoli che potrebbero interessarti
© MrPaloma 2021 - Viaggi - Foto -