Mohammad.sh
Mohammad.sh

Reputation: 255

Convert GMT to AEST

I have a dataframe like below:

Car id   time
car_41  2019-10-09 19:21:06
  .       .

The time type is datetime64[ns] and it's based on GMT; however, I want to convert it to AEST (Australian Eastern Standard Time) but I'm not sure how can I do it. any suggestions would be really appreciated.

Upvotes: 0

Views: 510

Answers (1)

Naveed
Naveed

Reputation: 11650

here is one way to do it

pd.to_datetime(df['time'], utc=True ).dt.tz_convert('Australia/ACT')
0   2019-10-10 06:21:06+11:00
Name: time, dtype: datetime64[ns, Australia/ACT]

Upvotes: 0

Related Questions