Last active
January 4, 2019 14:25
-
-
Save tomykaira/783f6974bf7cba838aef759886c28862 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ar birthdate = new Date(1970, 1, 1); | |
| var today = new Date(); | |
| var dayMs = 1000*60*60*24; | |
| var startAge = 10; | |
| var startPoint = new Date(birthdate.getTime()); | |
| startPoint.setYear(birthdate.getFullYear() + startAge); | |
| var accum = startPoint.getTime(); | |
| for (var i = startAge; i < 100; i ++) { | |
| accum += dayMs*365*i / startAge; | |
| console.log(i, new Date(accum), (today.getTime() - accum) / dayMs); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment