# Timestamps, Time Zones and Daylight Saving

> Time zone and timestamp errors silently break backtests. Learn UTC storage, daylight saving traps, exchange sessions, event versus receive time and bar labels.

Source: https://learn.tradelabsai.com/programming/timestamps-and-time-zones/  
Track: Programming and Data · Level: Advanced · Updated: 2026-10-03  
Publisher: TradeLabs AI (https://tradelabsai.com). Education, not financial advice.  
Cite as: TradeLabs Learn, "Timestamps, Time Zones and Daylight Saving", https://learn.tradelabsai.com/programming/timestamps-and-time-zones/

Every price, signal and order happens at a moment in time, and getting that time right is surprisingly hard. Markets operate in different time zones, daylight saving rules shift sessions twice a year on different dates in different countries, and data vendors label bars in different ways. A one hour error can make a strategy trade on information it should not have yet, or miss the session it was designed for. Most timestamp bugs are invisible: the code runs, the backtest finishes and the results are simply wrong.

## Golden rule: store in UTC

Store every timestamp in Coordinated Universal Time (UTC), which has no daylight saving changes. Convert to local exchange time only when you need it, such as finding the New York open or displaying a chart. Mixing local and UTC timestamps in the same dataset is one of the most common sources of silent errors.

## Daylight saving traps

| Region | Clocks change (typical rule) |
|---|---|
| United States | Second Sunday in March and first Sunday in November |
| European Union and UK | Last Sunday in March and last Sunday in October |
| Japan, China, India, Singapore | No daylight saving |
| Australia (some states) | Changes in October and April, the opposite season |

Because the US and Europe change on different dates, for a few weeks each year the gap between New York and London is four hours instead of five. A strategy trading the overlap of the London and New York sessions must handle this. See [Forex Trading Sessions](https://learn.tradelabsai.com/forex/forex-trading-sessions/) and [Trading Sessions](https://learn.tradelabsai.com/markets/trading-sessions/).

**Example: The shifting New York open**
The New York stock market opens at 9:30 Eastern Time. In winter, Eastern Standard Time is UTC minus 5 hours, so the open is 14:30 UTC. In summer, Eastern Daylight Time is UTC minus 4, so the open is 13:30 UTC. A strategy coded to "trade the open at 14:30 UTC" would trade the open in winter but trade one hour after the open all summer, a completely different market environment. Using a time zone library and converting "9:30 America/New_York" to UTC for each date avoids the error.

## Use time zone names, not fixed offsets

Write "America/New_York" or "Europe/London" rather than "UTC minus 5". Named zones from the IANA time zone database know the historical and future daylight saving rules. In Python, use the `zoneinfo` module or pandas' `tz_localize` and `tz_convert`.

```python
import pandas as pd
ts = pd.Timestamp("2026-07-15 09:30").tz_localize("America/New_York")
print(ts.tz_convert("UTC"))   # 2026-07-15 13:30:00+00:00
```

## Event time versus receive time

| Timestamp | Meaning |
|---|---|
| Event (exchange) time | When the trade or quote happened at the venue |
| Receive time | When your system received the message |
| Processing time | When your code acted on it |

Backtests should use the time information was available to you, which is close to receive time, not event time. The gap between them is your latency. See [Exchange vs Receive Timestamps and Latency Measurement](https://learn.tradelabsai.com/programming/latency-measurement/).

## Bar labels

A bar labelled 10:00 might cover 10:00 to 10:01 (start label) or 9:59 to 10:00 (end label). Daily bars may be labelled with the date but close at 16:00 New York time, which is the next calendar day in Asia. Always confirm the convention and treat a bar as known only after its end. See [Tick Data and OHLCV Data](https://learn.tradelabsai.com/programming/tick-data-and-ohlcv-data/) and [Look-Ahead Bias](https://learn.tradelabsai.com/research/look-ahead-bias/).

## Data release times

Economic data, earnings and other events have specific release times. A US jobs report at 8:30 Eastern is known at that moment, not at midnight of that date. Fundamental data in databases is often stamped with the period end date, not the date it was published. See [Point-in-Time and Survivorship-Free Data](https://learn.tradelabsai.com/programming/point-in-time-data/) and [Employment Data and Non-Farm Payrolls](https://learn.tradelabsai.com/macro/non-farm-payrolls/).

## Precision and clock accuracy

Use millisecond or finer precision for intraday data. Make sure your own servers' clocks are synchronised, since a drifting clock corrupts every receive timestamp. See [Clock Synchronization and PTP](https://learn.tradelabsai.com/infrastructure/clock-synchronization-and-ptp/).

## Frequently asked questions

### Why should I store trading data in UTC?

UTC has no daylight saving changes, so timestamps stay consistent and comparable across markets and seasons.

### How does daylight saving affect trading?

It shifts session times relative to UTC, and different regions change on different dates, which alters session overlaps for a few weeks each year.

### What is the difference between event time and receive time?

Event time is when something happened at the exchange; receive time is when your system learned about it. Backtests should respect receive time.

Next, learn how splits and dividends change price history in [Splits and Dividends in Price Data](https://learn.tradelabsai.com/programming/adjusted-prices/).

## Continue learning

- Next lesson: [Splits and Dividends in Price Data](https://learn.tradelabsai.com/programming/adjusted-prices/)
- Previous lesson: [Cleaning Market Data](https://learn.tradelabsai.com/programming/cleaning-market-data/)
- Related: [Cleaning Market Data](https://learn.tradelabsai.com/programming/cleaning-market-data/): Raw market data contains bad ticks, gaps, duplicates and wrong timestamps. Learn how to detect and fix common data errors without distorting your backtests.
- Related: [Trading Sessions](https://learn.tradelabsai.com/markets/trading-sessions/): Markets have sessions with different liquidity and volatility. Learn stock market hours, extended hours, the forex sessions and how timing affects your trades.
- Related: [Forex Trading Sessions](https://learn.tradelabsai.com/forex/forex-trading-sessions/): Forex trades 24 hours a day, five days a week, across four main sessions. Learn session times, overlaps, which pairs move when and how sessions affect spreads.
- Related: [Tick Data and OHLCV Data](https://learn.tradelabsai.com/programming/tick-data-and-ohlcv-data/): Tick data records every trade or quote; OHLCV bars summarise them by time. Learn how bars are built, other bar types, storage costs and which data a strategy needs.
- Related: [Clock Synchronization and PTP](https://learn.tradelabsai.com/infrastructure/clock-synchronization-and-ptp/): Accurate clocks are vital for timestamps, latency measurement and regulation. Learn how NTP and PTP work, MiFID II and CAT clock rules and how to check your clocks.
- Related: [Look-Ahead Bias](https://learn.tradelabsai.com/research/look-ahead-bias/): Look ahead bias happens when a backtest uses information that was not available at the time. Learn common sources, real examples and how to prevent it in code.
