A timestamp is a number used to represent a fixed point in a time.
Unlike date strings, which are relative to a specific timezone or location, a timestamp is absolute, and represents the same moment regardless of where a person lives.
Today, we’re going to look at how to work with timestamps in vanilla JS.
Unix time is the amount of time that have elapsed since midnight on January 1, 1970, UTC.
It’s a commonly used measure of time in operating systems and programming, and provides a handy way to create timestamps.
Working with dates in 2020 are still a mess. Presumably, they’ll also be a mess to work within 2021, 2022 and for a good while after that. Many (myself included) reach for a date library to fill the gaps. For years Moment.js reigned supreme and for good reason, it can do everything with dates, including working with different time zones. Unfortunately, Moment can also result in bundle bloat.