Background
I have a dataframe, df: I would like to convert the date timestamps from UTC to PST in both columns.
Connected Ended
3/3/2020 1:00:00 PM 3/3/2020 1:01:00 PM
3/4/2020 4:00:00 PM 3/4/2020 4:05:00 PM
Desired Output:
ConnectedPST EndedPST
3/3/2020 6:00:00 AM 3/3/2020 6:01:00 AM
3/4/2020 9:00:00 AM 3/4/2020 9:05:00 AM
Structure:
'Connected Ended\n0 3/3/2020 1:00:00 PM 3/3/2020 1:01:00 PM\n1 3/4/2020 4:00:00 PM 3/4/2020 4:05:00 PM'
What I have tried:
from datetime import datetime
from pytz import timezone
datetime_obj_pacific = timezone('US/Pacific').localize(datetime_obj_naive)
print datetime_obj_pacific.strftime ("%Y-%m-%d %H:%M:%S %Z%z")
However, I am not sure how to incorporate this into my dataframe. Any assistance is appreciated.