Syntax - Tasty Web Development Treats cover image

720: Where Does Time Come From?

Syntax - Tasty Web Development Treats

00:00

Utilizing Epoch Time for Efficient Date Storage and the Y2K 2038 Problem

Epoch time, the number of seconds elapsed since January 1st 1970, provides a convenient way to store time as an integer. Converting dates to epoch time is beneficial for saving and accessing dates in databases. However, a potential issue, known as the 2038 problem, arises due to the representation of epoch time as a 32-bit integer, causing overflow and breaking epoch times on January 19th, 2038. To address this, many systems have transitioned to 64-bit integers for defining epoch time. JavaScript, on the other hand, stores epoch time as 16-bit floating point numbers, thus avoiding the 2038 problem. Consequently, JavaScript has been updated to handle epoch time effectively without being affected by the 2038 problem.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app