Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

javashit datetime localization help

Name: homura 2022-02-17 21:58

how do i make
<span class="datetime">1234567890</span>
become <span class="datetime">2009-02-13 18:31</span>
(eg for someone in eastern time; shows in user's local timezone)

pretend i have a lot of <span class="datetime"> scattered about and i want it to either be rendered in local time or in relative "time until" / "time since" units (eg `3 days, 5 hours ago`...)

thanks

Name: homura 2022-02-17 22:14

We did it reddit!

this is a date: <span class="datetime">1234567890000</span>
<p>
another date: <span class="datetime">1645136003000</span>

<script>
Array.from(document.getElementsByClassName('datetime')).map((a) => { return a.textContent = new Date(a.textContent-0).toISOString() })
</script>

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List