February 18th 2018

Today I’ve decided to get a refresher regarding date & time handling in software, especially in Java, JavaScript and MongoDB, which I happen to use a lot at work.

Well, the Internet being what it is, I’ve learnt a lot about time in general. Time is hard, humans struggle to get a stable measure and sufficient accuracy for their applications. Actually, we also have difficulties to define the very notion of time. Here are some Wikipedia articles that I’ve found of interest:

Here are some lessons learnt (or re-learnt), and other considerations. I may be wrong about some of them (if you happen to read this, please correct me!). When in doubt, I’ve read more docs and source code (java.time, MongoDb driver, Jackson), and have run various JS and Java unit tests or MongoDB manual tests. I record those considerations here for future reference or in case it can help anyone. No reference is provided, as this post exists mostly for me, I and myself; plus it is straightforward to find the documentation and source code of the projects mentioned below.