Possible Duplicate:
How to calculate the number of days between two dates using JavaScript?
I wonder with the current date, how can I get the age in days.
For example at date 12/4/1995 returned 6435.
Is there any library function that does this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can compose two dates and subtract them. The result will be in milliseconds, so you have to convert that to days:
You can then round
days(and as appropriate.