bocciaman

Age Calculator - Working

May 19th, 2022 (edited)
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var dob = new Date("mm/dd/yyyy");  
  2. var month_diff = Date.now() - dob.getTime();  
  3. var age_dt = new Date(month_diff);    
  4. var year = age_dt.getUTCFullYear();  
  5. var age = Math.abs(year - 1970);    
  6.  
  7. let result = + age;        
  8.  
  9. result
  10.  
  11. //Insert date numbers in proper format above in line one.
  12. //This script is meant to be used within an automation tool like TextExpander.
Add Comment
Please, Sign In to add comment