Convert Unix Timestamp to Pacific Time (Auto DST Handling)
Use this page to convert timestamp to Pacific Time with DST — enter any Unix or epoch timestamp below and get an instant, daylight-saving-aware result in PST or PDT.
Seconds since Jan 1, 1970 UTC. Millisecond values are detected automatically.
What Is Pacific Time? (PST vs PDT)
| PST | PDT | |
|---|---|---|
| Full name | Pacific Standard Time | Pacific Daylight Time |
| UTC offset | UTC−8 | UTC−7 |
| Active period | Nov – Mar | Mar – Nov |
| DST active? | No | Yes |
“Pacific Time” is not a fixed UTC offset. The US Pacific timezone switches between PST (UTC−8) in winter and PDT (UTC−7) in summer when Daylight Saving Time is in effect. That is why hardcoding -8 in your code is one of the most common timestamp conversion bugs — your summer timestamps will be off by a full hour.
For any production system, always use the IANA timezone identifier America/Los_Angeles instead of a raw numeric offset. It covers Los Angeles, San Francisco, Seattle, Portland, and the entire US Pacific region.
How the Conversion Works
Converting a unix timestamp to Pacific Time is straightforward once you account for DST. Here is the three-step process this converter (and every reliable library) follows.
Step 1 — Identify the timestamp type
- Unix timestamp — seconds since January 1, 1970 00:00:00 UTC (e.g.
1711324800) - Milliseconds timestamp — divide by 1000 first (e.g. JavaScript’s
Date.now()returns milliseconds)
Step 2 — Determine the UTC offset for that date
- Before the second Sunday in March → PST (UTC−8)
- After the second Sunday in March, before the first Sunday in November → PDT (UTC−7)
The offset depends on the instant represented by the timestamp, not today’s date. A timestamp from January and one from July will resolve to different offsets even though both are “Pacific Time.”
Step 3 — Apply the offset
Pacific Time = UTC Time + offset
Where offset = −8 (PST) or −7 (PDT). In practice, you should never calculate this manually — use a timezone library that reads the IANA rules for America/Los_Angeles.
Code Examples — Convert Timestamp to Pacific Time with DST
Python
from datetime import datetime
from zoneinfo import ZoneInfo # Python 3.9+
timestamp = 1711324800 # Example: March 25, 2024 00:00 UTC
dt = datetime.fromtimestamp(timestamp, tz=ZoneInfo("America/Los_Angeles"))
print(dt.strftime("%Y-%m-%d %H:%M:%S %Z"))
# Output: 2024-03-24 17:00:00 PDT
For Python versions before 3.9, use pytz:
import pytz
from datetime import datetime
dt = datetime.fromtimestamp(1711324800, tz=pytz.timezone("America/Los_Angeles"))
JavaScript
const timestamp = 1711324800; // seconds
const date = new Date(timestamp * 1000);
const pacificTime = date.toLocaleString("en-US", {
timeZone: "America/Los_Angeles",
dateStyle: "full",
timeStyle: "long"
});
console.log(pacificTime);
// Output: Sunday, March 24, 2024 at 5:00:00 PM PDT
PostgreSQL / SQL
SELECT
TO_TIMESTAMP(1711324800) AT TIME ZONE 'UTC'
AT TIME ZONE 'America/Los_Angeles' AS pacific_time;
-- Result: 2024-03-24 17:00:00
Java
import java.time.*;
long timestamp = 1711324800L;
ZonedDateTime pacific = Instant.ofEpochSecond(timestamp)
.atZone(ZoneId.of("America/Los_Angeles"));
System.out.println(pacific);
// Output: 2024-03-24T17:00-07:00[America/Los_Angeles]
DST Transition Dates (Pacific Time)
| Year | DST Starts (Spring Forward) | DST Ends (Fall Back) |
|---|---|---|
| 2024 | March 10, 2:00 AM | November 3, 2:00 AM |
| 2025 | March 9, 2:00 AM | November 2, 2:00 AM |
| 2026 | March 8, 2:00 AM | November 1, 2:00 AM |
| 2027 | March 14, 2:00 AM | November 7, 2:00 AM |
During the spring-forward transition, 2:00–2:59 AM local time does not exist — clocks jump from 1:59 AM to 3:00 AM. During fall-back, 1:00–1:59 AM occurs twice, creating an ambiguous hour. Libraries like Python’s zoneinfo and JavaScript’s Intl API resolve these edge cases automatically; manual offset math does not.
Common Mistakes When Converting to Pacific Time
Using a hardcoded −8 offset — This only works in winter (PST). In summer, Pacific Time is UTC−7 (PDT). Always use the America/Los_Angeles IANA timezone name instead of a raw offset.
Forgetting to convert milliseconds — JavaScript Date.now() returns milliseconds. Divide by 1000 before passing to most timestamp converters and server-side APIs that expect epoch seconds.
Not accounting for the DST gap and overlap — Times during the spring-forward hour are invalid; times during the fall-back hour are ambiguous. Libraries like zoneinfo (Python) and Intl (JS) handle this automatically. Rolling your own offset logic will eventually break on transition weekends.
Storing local time instead of UTC — Store timestamps as UTC or epoch seconds internally. Convert to Pacific Time only at the display layer, using the user’s or application’s configured timezone.
Frequently Asked Questions
Q: What is the UTC offset for Pacific Time right now?
A: It depends on the time of year. From mid-March to early November, Pacific Time is UTC−7 (PDT). The rest of the year it is UTC−8 (PST). Use the converter above to check any specific timestamp.
Q: What is the difference between PST and PDT?
A: PST (Pacific Standard Time) is UTC−8 and is active from November to March. PDT (Pacific Daylight Time) is UTC−7 and is active from March to November during Daylight Saving Time.
Q: How do I convert a Unix timestamp to Pacific Time in Python?
A: Use datetime.fromtimestamp(ts, tz=ZoneInfo("America/Los_Angeles")) from the zoneinfo module (Python 3.9+). For older versions, use pytz.timezone("America/Los_Angeles").
Q: What IANA timezone name should I use for Pacific Time?
A: Always use America/Los_Angeles. This is the correct IANA identifier that covers both PST and PDT and is supported in Python, JavaScript, Java, SQL, and virtually every major programming language and database.
Q: When does Daylight Saving Time start and end in the Pacific timezone?
A: DST begins on the second Sunday in March (clocks move from 2:00 AM to 3:00 AM) and ends on the first Sunday in November (clocks move from 2:00 AM back to 1:00 AM).
Q: Why does my timestamp conversion show the wrong Pacific Time?
A: The most common cause is using a hardcoded UTC−8 offset year-round instead of a DST-aware timezone library. Another cause is working with milliseconds instead of seconds — divide JavaScript timestamps by 1000 before converting.
Q: Is Pacific Time the same as Los Angeles time?
A: Yes. America/Los_Angeles is the IANA timezone for the entire US Pacific timezone, including cities like Los Angeles, San Francisco, Seattle, and Portland.