Small update

This commit is contained in:
DarkCat09 2021-02-20 10:44:09 +04:00
parent eb52b56c15
commit 13af9cffa6
3 changed files with 73 additions and 15 deletions

10
js/script.js Normal file
View file

@ -0,0 +1,10 @@
// Computing My Age
// Вычисление моего возраста
var birthday = new Date(2009, 7, 13, 13);
try {
// https://ru.stackoverflow.com/questions/576478/javascript-Вычисление-возраста-по-дате-рождения
document.getElementById('age-js').innerHTML = Math.floor((Date.now() - birthday.getTime()) / (24 * 3600 * 365.25 * 1000));
}
catch (ex) {
console.log('Произошла ошибка при попытке рендеринга моего возраста! Подробнее:\n' + ex.message);
}