Tags » datetime shenanigans
Localising the
<time>
with JavaScriptI’m using the
<time>
element and some JavaScript to display timestamps as human-readable, localised timestamps. Something likeTue, 15 Apr 2025 at 20:45 BST
is easier to read than2025-04-15T19:45:00Z
.TIL: There’s a musical that tells you the number of minutes in a year
The song Seasons of Love from Rent starts with the line “Five hundred twenty-five thousand, six hundred minutes”.
Preserving Dates during JSON serialisation with vanilla JS
How to make sure you get a
Date
back when you callJSON.parse
andJSON.stringify
.Have a single definition of “now”
Having one function that you always use to get the current time is super handy when debugging issues that only occur at specific times.
What year is it? (A tale of ISO week dates)
If you use ICU date formatting, make sure you use the right format specifier for year.
Finding the months between two dates in Python
Showing human-friendly dates in JavaScript
What’s a nicer way to show a date than an ISO 8601 timestamp?
Falsehoods programmers believe about Unix time
It’s not quite the number of seconds since 1 January 1970.
Darwin, pancakes and birthdays
Looking at whether Darwin ever missed out on birthday cake for pancakes