Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get years since date

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