From my understanding, option daily bars seem timestamped at ~00:00 of T+1, so when I align to trading day (shift −1 day), I still can’t find 0DTE rows on the particular day — only 1DTE (e.g., time shows 2024-02-01, expiry=2024-02-02; no row for trading day 2024-02-02 with expiry=2024-02-02) (as shown in the image).

So my Question is:

1.  Is the T+1 timestamp for daily option bars by design? Any official guidance to map to trading day?

2.  Recommended method to get 0DTE (same-day time and expiry)? 

Please kindly help me with this and congratulations on your successful platform!

from datetime import datetime, timedelta
import pandas as pd
import pandas_market_calendars as mcal

pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)

qb = QuantBook()
start_date = datetime(2024, 1, 31)
end_date = datetime(2024, 2, 2) 
equity_symbol = qb.add_equity("AAPL", data_normalization_mode=DataNormalizationMode.RAW).symbol
option = qb.add_option(equity_symbol)
option.set_filter(lambda u: u.include_weeklys())
history_df = qb.history(option.symbol, start_date-timedelta(20), end_date, flatten=True)

df = history_df.reset_index()
df['time'] = df['time'] - pd.Timedelta(days=1)
df["expiry"] = df["symbol"].map(lambda s: s.id.date)
df["strike"] = df["symbol"].map(lambda s: s.id.strike_price)
df["PutCall"]  = df["symbol"].map(lambda s: "C" if s.id.option_right == OptionRight.CALL else "P")
df = df[['time', 'expiry', 'symbol', 'PutCall', 'strike', 'open', 'high', 'low', 'close', 'value', 'volume', 'openinterest', 'impliedvolatility', 'delta', 'gamma', 'theta', 'vega', 'rho', 'underlying']]
df[(df['strike'] == 185) & (df['PutCall'] == 'C') & (df['expiry'] == '2024-02-02')]
sin-chi-man_1755378432.jpg