<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">I’ve just finished an extensive update of a JavaScript/TypeScript date/time library that I’d previously used only for my own astronomy website, <a href="http://skyviewcafe.com" class="">skyviewcafe.com</a>. I’ve done enough updates to this library now that it may be of interest to many other software developers, especially if they want to handle the odd edge cases that exist in timezone handling, like 47-hour days and missing days and the like. One unique features is that it's possible for users to get live updates of the tz database, which usually don’t become available to applications without, at the very least, restarting an application, if not rebooting one’s computer.</div><div class=""><br class=""></div><div class="">Libraries in this category are hardly unique, but one of the most popular libraries, Moment.js, is being phased out, so this seemed to be to be a good time to introduce a new one.</div><div class=""><br class=""></div><div class="">Among the (possible) unique features, you can do things like find the specific moments of DST transitions and other transitions, like UTC offset changes, and get descriptions of these changes, like this:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Courier New" class=""><span style="font-style: normal;" class="">new DateTime('2021-11-07', 'America/New_York').getDiscontinuityDuringDay() →</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style: normal;" class="">{ start: '02:00:00', end: '01:00:00', delta: -3600000 } // fall back!</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style: normal;" class=""><br class=""></span></font></div><div class=""><font face="Courier New" class=""><span style="font-style: normal;" class="">// As soon as it’s midnight on the 30th, it’s instantly midnight on the 31st, erasing 24 hours:<br></span></font></div><div class=""><font face="Courier New" class=""><span style="font-style: normal;" class="">new DateTime('2011-12-30', 'Pacific/Apia').getDiscontinuityDuringDay()) →</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style: normal;" class="">{ start: '00:00:00', end: '24:00:00', delta: 86400000 }</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style: normal;" class=""><br class=""></span></font></div><div class=""><font face="Courier New" class=""><span style="font-style: normal;" class="">// As soon as it’s midnight on the 31th, turn back to 1AM on the 30th, adding 23 hours to the day:<br></span></font></div><div class=""><font face="Courier New" class=""><span style="font-style: normal;" class="">new DateTime('1969-09-30', 'Pacific/Kwajalein').getDiscontinuityDuringDay() →</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style: normal;" class="">{ start: '24:00:00', end: '01:00:00', delta: -82800000 }</span></font></div><div class=""><br class=""></div></div><div class="">My updated library can be found here: <a href="https://www.npmjs.com/package/@tubular/time" class="">https://www.npmjs.com/package/@tubular/time</a></div><div class=""><br class=""></div><div class="">Besides the IANA timezone support, this library also features the ability to handle variable switch-over from the Julian to the Gregorian calendar, which can be of helpful to those handling historical dates.</div><div class=""><br class=""></div></body></html>