From c9ad067ef96e32e4d5b7dff031b487147e9d1df0 Mon Sep 17 00:00:00 2001 From: Octo Andri <6083316-octospacc@users.noreply.gitlab.com> Date: Sun, 17 Apr 2022 17:19:29 +0000 Subject: [PATCH] Add counter --- public/Assets/JS/CurrentAge.js | 20 ++++++++++++++++++++ public/index.html | 14 +++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 public/Assets/JS/CurrentAge.js diff --git a/public/Assets/JS/CurrentAge.js b/public/Assets/JS/CurrentAge.js new file mode 100644 index 0000000..f02dc83 --- /dev/null +++ b/public/Assets/JS/CurrentAge.js @@ -0,0 +1,20 @@ +// All Unix time values are in milliseconds (ms) +const UnixDay = 86400000; +const UnixYear = 31536000000; +const BirthTime = 1082713500000; + +function UnixTime() { + let DateNow = Date.now(); + let TimeSinceBirth = DateNow - BirthTime; + let YearsSinceBirth = TimeSinceBirth / UnixYear; + let LeapYears = ~~(YearsSinceBirth / 4); + return DateNow - UnixDay*LeapYears; +} + +function UnixAgeNow() { + return UnixTime() - BirthTime; +} + +function UnixToYears() { + return UnixAgeNow() / UnixYear; +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index 168f53c..18e944a 100644 --- a/public/index.html +++ b/public/index.html @@ -13,6 +13,7 @@ + @@ -25,9 +26,20 @@

Fumo Prisms (!)


My WebPinBoard

+

+
+

+ +



- +