Skip to content

Instantly share code, notes, and snippets.

@robertjd
Created September 24, 2013 21:17
Show Gist options
  • Save robertjd/6691388 to your computer and use it in GitHub Desktop.
Save robertjd/6691388 to your computer and use it in GitHub Desktop.
javascript compute months passed
function monthsPassed(fromDate,toDate){
return toDate.getMonth() - fromDate.getMonth() + (12 * ( toDate.getFullYear() - fromDate.getFullYear() ))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment