Unix timestamp and time zones: one number, many clocks

By TechCompare · Updated · How we check

A Unix timestamp has no zone attached, so 1780511400 points to one instant for every reader. Show it in a named zone such as Asia/Kolkata, and the library picks the right offset for each date.

1780511400 is 18:30:00 UTC on June 3, 2026. New York, Amsterdam and Kolkata each show their own wall time for that moment, but the number stays 1780511400 in all of them. Changing the zone changes the clock, never the count. The rest of this page shows the clocks, the code, and where dates go wrong.

Unix timestamp
1,780,511,400
Seconds since epoch
ISO 8601
2026-06-03T18:30:00.000Z
Wed, 03 Jun 2026 18:30:00 GMT
Category
Time Zones
Timestamp knowledge base

How this is calculated

The same moment on four clocks:

  • UTC: 18:30:00 on Wednesday, June 3, 2026
  • New York: 14:30:00 on Wednesday, June 3, 2026, offset UTC-4
  • Amsterdam: 20:30:00 on Wednesday, June 3, 2026, offset UTC+2
  • Kolkata: 00:00:00 on Thursday, June 4, 2026, offset UTC+5:30

The Z at the end of 2026-06-03T18:30:00.000Z means UTC. A string can also end in an offset such as +02:00, which names the same moment on a different clock. A string with neither leaves the reader to guess the zone. The ISO 8601 vs Unix page compares the two formats, so this page sticks to the zone part.

A zone's offset isn't always fixed. New York uses UTC-5 on January 1, 2026 and UTC-4 on June 3, 2026. Amsterdam changes too: UTC+1 on January 1, 2026 and UTC+2 on June 3, 2026. A zone that changes its offset can't be covered by one fixed number, so pick the zone by name. The IANA Time Zone Database records the history of local time for many places, and a name like America/New_York lets the library pick the offset for each date. Kolkata's offset is UTC+5:30, so adding a whole number of hours to UTC gets it wrong.

JavaScript's toLocaleString returns a formatted string, and Python's fromtimestamp returns a datetime object. Both snippets show the Kolkata wall clock for 1780511400. Python's second argument sets the zone. Without it, the result is a datetime with no zone attached, in the machine's local time.

JavaScript
new Date(1780511400000).toLocaleString("en-US", { timeZone: "Asia/Kolkata" })
// Kolkata clock: 00:00:00 on June 4, 2026
Python
from datetime import datetime
from zoneinfo import ZoneInfo
kolkata = datetime.fromtimestamp(1780511400, ZoneInfo("Asia/Kolkata"))
print(kolkata)  # Kolkata clock: 00:00:00 on June 4, 2026

Both snippets start from the same number and give the same instant, just on Kolkata's clock.

Verdict

These five rules keep the stored number and the shown clock apart:

  • Store timestamps in UTC (or ISO strings ending in Z), never local time strings.
  • Keep each user's zone as an IANA name like Europe/Amsterdam, not as a fixed offset.
  • Convert only when you show a time, and do the math on the number.
  • Never fix a zone by adding hours by hand.
  • Test one winter date and one summer date, since some zones change their offset between them.

A meeting at 9:00 local time next year has no timestamp yet. The zone's rules decide which moment the local time names, so store the local date, the time and the zone name, and compute the timestamp when you need it. That keeps the meeting in the terms people agreed on.

More Timestamp scenarios

Frequently asked questions

Is a Unix timestamp in UTC?
The count starts at the epoch, midnight UTC on January 1, 1970, as MDN's Date reference defines it, so the number has no zone attached. 1780511400 is 18:30:00 UTC on June 3, 2026 for every reader. Python's fromtimestamp() converts to the machine's local time when you leave out tz, as the Python datetime docs explain.
Why does the same timestamp show a different date in Kolkata?
Kolkata is already on June 4, 2026, while UTC still reads June 3, 2026. A common mistake is formatting the date in UTC or on the server instead of in the reader's zone. Pass the zone name to the formatter, and the date matches the reader's clock.
Why is my timestamp an hour off in winter?
A hard-coded offset is one common cause, because some zones change their offset during the year. The New York offset is UTC-5 on January 1, 2026 but UTC-4 on June 3, 2026, so one hard-coded value can match only one of those dates. Store the zone name, like America/New_York, and the library picks the offset for each date.
Should I store the time zone with the timestamp?
Store the timestamp for the moment, and store the user's zone as a separate IANA name, such as Europe/Amsterdam. The zone tells you how to show the moment, but it doesn't change the moment. For a future local time, store the local date, the time and the zone name instead, as the verdict above explains.
How do I convert a Unix timestamp to local time in JavaScript?
JavaScript's Date counts milliseconds, as MDN's Date.now() page describes, so multiply seconds by 1000 first. Then pass the zone to toLocaleString: new Date(timestamp * 1000).toLocaleString('en-US', { timeZone: 'Asia/Kolkata' }). The MDN Intl.DateTimeFormat reference says the default is the runtime's own zone, so always pass the reader's IANA name.