mirror of
https://github.com/hexahigh/080609.git
synced 2025-12-11 19:55:06 +01:00
added age in millieseconds
This commit is contained in:
parent
995fc1efe5
commit
c7c534d418
@ -22,6 +22,7 @@
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<p>Want to know how old you are in millieseconds? <a href="ms.html">Go here</a></p>
|
||||
<h3>What day was my birthday Jun 8, 2009?</h3>
|
||||
<p>June 8, 2009 was a Monday and it was the 159th day of the year 2009. It was the 23rd Monday of that year. The
|
||||
next time you can reuse your old 2009 calendar will be in 2026. Both calendars will be exactly the same!
|
||||
|
||||
11
ms.html
Normal file
11
ms.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>How old are you in millieseconds?</title>
|
||||
</head>
|
||||
<body>
|
||||
<p id="number"></p>
|
||||
</body>
|
||||
</html>
|
||||
15
ms.js
Normal file
15
ms.js
Normal file
@ -0,0 +1,15 @@
|
||||
function calculateYearsSince() {
|
||||
const myDate = new Date('2009-06-08');
|
||||
|
||||
const diffInMs = Date.now() - myDate.getTime();
|
||||
const diffInYears = diffInMs / (1000 * 60 * 60 * 24 * 365.25);
|
||||
const days = Math.floor(diffInMs / (1000 * 60 * 60 * 24));
|
||||
const hours = Math.floor(hoursSince())
|
||||
const minutes = Math.floor(diffInMs / 1000 / 60)
|
||||
//const hours = Math.floor((diffInMs % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
||||
//const minutes = Math.floor((diffInMs % (1000 * 60 * 60)) / (1000 * 60));
|
||||
|
||||
document.getElementById("number").innerText = diffInMs
|
||||
}
|
||||
|
||||
setInterval(calculateYearsSince, 0.1)
|
||||
Loading…
x
Reference in New Issue
Block a user