Skip to content Skip to sidebar Skip to footer

How To Convert A List Of Timestamps In An Excel File From Utc To San Francisco Time (pacific Time) With Python?

Let's say I have an excel file named 'hello123.xlsx'. There is a column of timestamps that has a lot of rows (more than 50,000 rows). The image attached here is basically what the

Solution 1:

Please take a look at this post: need to convert UTC (aws ec2) to PST in python

from datetime import datetime
from pytz import timezone
import pytz

date_format='%m/%d/%Y %H:%M:%S %Z'
date = datetime.now(tz=pytz.utc)
print 'Current date & time is:', date.strftime(date_format)

date = date.astimezone(timezone('US/Pacific'))

print 'Local date & time is  :', date.strftime(date_format)

Post a Comment for "How To Convert A List Of Timestamps In An Excel File From Utc To San Francisco Time (pacific Time) With Python?"