Se io passassi le date da due caselle di testo in formato gg/mm/aaaa ?Originariamente inviato da br1
Che io sappia il datediff() di vb fa una semplice differenza del numero del mese senza riguardo per il giorno... se e' quello che vuoi ...
prima = new Date(2009,01,28);
seconda = new Date(2010,04,31);
mesiDiff = (seconda.getFullYear() - prima.getFullYear())*12 + seconda.getMonth()) - prima.getMonth();
ciao
Ho visto che esiste anche una funzione Datediff per javascript.
DateDiff Function
Returns a Variant (Long) specifying the number of time intervals between two specified dates
.
Syntax
DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]])
The DateDiff function syntax has these named arguments:
Part Description
interval Required. String expression that is the interval of time you use to calculate the difference between date1 and date2.
The interval argument has these settings:
Setting Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week
h Hour
n Minute