Created
February 9, 2021 14:53
-
-
Save kybernetikos/6eb7cec56e2b80180d33030f13beeab7 to your computer and use it in GitHub Desktop.
Calculate age in minutes
This file contains 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
<html> | |
<head> | |
<style> | |
body { | |
background-color: turquoise; | |
} | |
#age { | |
color: white; | |
font-size: xxx-large; | |
font-family: sans-serif; | |
margin: 100px; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="age" /> | |
<script> | |
const placeToShowAge = document.getElementById('age') | |
const myBirth = new Date('2010-12-05T17:00:00') | |
setInterval(() => { | |
placeToShowAge.innerText = Math.floor((Date.now() - myBirth.getTime()) / 1000 / 60).toLocaleString() | |
}, 250) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment