 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python Pandas - Convert Timestamp to another time zone
Convert Timestamp to another time zone, use the timestamp.tz_convert(). Set the time zone as the parameter. At first, import the required libraries −
import pandas as pd
Create the timestamp object in Pandas. We have also set the timezone
timestamp = pd.Timestamp('2021-10-14T15:12:34.261811624', tz='US/Eastern')  Convert timezone of timestamp
timestamp.tz_convert('Australia/Brisbane')) Example
Following is the code
 import pandas as pd # set the timestamp object in Pandas # we have also set the timezone timestamp = pd.Timestamp('2021-10-14T15:12:34.261811624', tz='US/Eastern') # display the Timestamp print("Timestamp...\n", timestamp) # convert timezone print("\nConvert the Timestamp timezone...\n", timestamp.tz_convert('Australia/Brisbane'))  Output
This will produce the following code
Timestamp... 2021-10-14 15:12:34.261811624-04:00 Convert the Timestamp timezone... 2021-10-15 05:12:34.261811624+10:00
Advertisements
 