| Author |
Get Number of Months From two Dates using Javascript
|
Sreenivas Reddy Tatikunta
Greenhorn
Joined: Aug 23, 2011
Posts: 24
|
|
Hi All,
I have following dates in javascript,
var date1 = 05-30-2011
var date2= 08-23-2011(Current Date)
It should compare both dates and return number months. This example result is 2 months 23 days (Here days not required only should return exact months). Using javascript.
If anyone have idea could you please help me...
Thanks & Regards
Sreenivas Reddy.T
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Looks like you need:
new Date()getFullYear()getMonth()
Eric
|
 |
 |
|
|
subject: Get Number of Months From two Dates using Javascript
|
|
|