the below command seems to work for a other locations in Asia except for any location in India. Is there a bug here or am I missing something? this works:
pd.to_datetime(pd.datetime.now()).tz_localize('US/Pacific').tz_convert('Asia/Hong_Kong')
pd.to_datetime(pd.datetime.now()).tz_localize('US/Pacific').tz_convert('Asia/Karachi'
pd.to_datetime(pd.datetime.now()).tz_localize('US/Pacific').tz_convert('Asia/Dubai')
this does not work with exactly the same format (like any location in India):
pd.to_datetime(pd.datetime.now()).tz_localize('US/Pacific').tz_convert('Asia/New_Delhi')
throwing the below error
File "C:\Miniconda\lib\site-packages\pytz\__init__.py", line 180, in timezone
raise UnknownTimeZoneError(zone) UnknownTimeZoneError: 'Asia/New_Delhi'
pandas uses the the time zones in the tz database. You can find a list of all available time zone codes for example in wikipedia.
For India, you would use Asia/Kolkata
pd.to_datetime(pd.datetime.now()).tz_localize('US/Pacific').tz_convert('Asia/Kolkata')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With