Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Javascript get years since date

getAge() {
    let currentTime = new Date().getTime();
    let birthDateTime= new Date('DATE GOES HERE').getTime();
    let difference = (currentTime - birthDateTime);
    return Math.floor(difference/(1000*60*60*24*365));
}
Source by github.com #
 
PREVIOUS NEXT
Tagged: #Javascript #years #date
ADD COMMENT
Topic
Name
1+2 =