Unix timestamps and time zones explained simply
Dates and times cause more bugs than almost anything else in software. A few ideas make them much less confusing.
What a Unix timestamp is
A Unix timestamp is the number of seconds since 00:00:00 UTC on 1 January 1970, a moment called the epoch. For example, 1700000000 is 14 November 2023, 22:13:20 UTC.
It is just a number, so it is easy to store, sort and compare, and it means the same thing everywhere in the world.
Seconds or milliseconds?
Some systems count in seconds (10 digits today) and others, including JavaScript, count in milliseconds (13 digits). If a converted date lands in January 1970, you probably gave seconds to something that expects milliseconds. The timestamp converter lets you choose the unit.
UTC and time zones
UTC is the world's reference time and has no daylight saving. A time zone is an offset from UTC: Bangladesh is UTC+06:00, India UTC+05:30, and New York is UTC-05:00 in winter.
A timestamp has no time zone. The zone only matters when you show it to a person, which is when you convert it to local time.
Daylight saving makes offsets change
Many places change their clocks twice a year. New York is UTC-05:00 in winter and UTC-04:00 in summer. This is why a meeting at "9 am New York time" lands at a different hour in Dhaka depending on the date. The time zone converter applies the right offset for the date you choose.
Rules that prevent bugs
- Store and send times in UTC, and convert to local time only for display.
- Use the ISO 8601 format, such as 2026-10-18T14:30:00Z. The Z means UTC.
- Never write your own daylight saving rules. Use a library or the built-in time zone database.
- Say which zone you mean when you write a time to someone else, for example "3 pm UTC".
The year 2038 problem
Systems that store the timestamp as a signed 32-bit number run out in January 2038, when it passes 2,147,483,647. Modern systems use 64 bits, which lasts for billions of years, but some old software and databases are still affected.
Where you will meet timestamps
Log files, databases, APIs and login tokens all use them. A JWT, for instance, stores its issue and expiry times as Unix seconds. The JWT decoder turns those into normal dates.