Update timezone on time page to be dynamic

Signed-off-by: Louis Hollingworth <louis@hollingworth.ch>
This commit is contained in:
Louis Hollingworth 2022-10-02 15:51:27 +01:00
parent 1e847898b9
commit 426ae17597
Signed by: lucxjo
GPG key ID: B140F8923EF88DA9

View file

@ -1,6 +1,7 @@
--- ---
import NavBar from "../../components/NavBar.astro"; import NavBar from "../../components/NavBar.astro";
import TimeZone from "../../components/TimeZone.vue";
import Layout from "../../layouts/Layout.astro"; import Layout from "../../layouts/Layout.astro";
const crntTime = Date.now(); const crntTime = Date.now();
@ -29,7 +30,7 @@ const navLinks = [
<h1 class="title">Time Utilities</h1> <h1 class="title">Time Utilities</h1>
<p> <p>
Your current timezone: Your current timezone:
{ Intl.DateTimeFormat().resolvedOptions().timeZone } <TimeZone client:load />
</p> </p>
<p>The current time in Unix Epoch: <code>{ Math.floor(crntTime / 1000) }</code> <br /> or <code>{crntTime}</code> in Unix millis</p> <p>The current time in Unix Epoch: <code>{ Math.floor(crntTime / 1000) }</code> <br /> or <code>{crntTime}</code> in Unix millis</p>