Period

Read Microsoft's intraday stock price

read data

Two types of datetimes in python

  1. Naive (no timezone awareness)

  2. Timezone aware datetime

Convert naive DatetimeIndex to timezone aware DatetimeIndex using tz_localize

Convert to Berlin time using tz_convert

All time zones

Using timezones in date_range

timezone using pytz

timezone using dateutil

Pandas documentation indicates that difference between pytz timezone and dateutil timezones is

  1. In pytz you can find a list of common (and less common) time zones using from pytz import common_timezones, all_timezones

  2. dateutil uses the OS timezones so there isn’t a fixed list available. For common zones, the names are the same as pytz

Last updated

Was this helpful?