Convert Time Zones using Python pytz package | Python datetime package

Pubblicato il: 01 giugno 2018
sul canale di: technologyCult
2,932
24

Convert Time Zones using Python pytz package | Python datetime package

Topic to be covered - Convert Time Zones

UTC is the time standard commonly used across the world.
The world's timing centers have agreed to keep their time scales
closely synchronized - or coordinated - therefore the name Coordinated Universal Time.

'''

Code Starts Here
==============

from datetime import datetime
from pytz import timezone

fmt = "%Y-%m-%d %H:%M:%S %Z%z"

get the current time in UTC
now_utc = datetime.now(timezone('UTC'))
print('UTC :', now_utc)

Convert this to EST
now_est = now_utc.astimezone(timezone('US/Eastern'))
print('EST :', now_est)

now_berlin = now_utc.astimezone(timezone('Europe/Berlin'))
print('Berlin:', now_berlin)

now_london = now_utc.astimezone(timezone('Europe/London'))
print('London:', now_london)

now_Kolkata = now_utc.astimezone(timezone('Asia/Kolkata'))
print('Kolkata:', now_Kolkata)

now_Shanghai = now_utc.astimezone(timezone('Asia/Shanghai'))
print('Shanghai:',now_Shanghai)

now_Sydney = now_utc.astimezone(timezone('Australia/Sydney'))
print('Sydney:',now_Sydney)

now_Johannesburg = now_utc.astimezone(timezone('Africa/Johannesburg'))
print('Johannesburg:',now_Johannesburg)

All Playlist of this youtube channel
====================================

1. Data Preprocessing in Machine Learning
   • Data Preprocessing in Machine Learning| Li...  

2. Confusion Matrix in Machine Learning, ML, AI
   • Confusion Matrix in Machine Learning, ML, AI  

3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
   • Anaconda | Python Installation | Spyder | ...  

4. Cross Validation, Sampling, train test split in Machine Learning
   • Cross Validation | Sampling | train test s...  

5. Drop and Delete Operations in Python Pandas
   • Drop and Delete Operations in Python Pandas  

6. Matrices and Vectors with python
   • Matrices and Vectors with python  

7. Detect Outliers in Machine Learning
   • Detect Outliers in Machine Learning  

8. TimeSeries preprocessing in Machine Learning
   • TimeSeries preprocessing in Machine Learning  

9. Handling Missing Values in Machine Learning
   • Handling Missing Values in Machine Learning  

10. Dummy Encoding Encoding in Machine Learning
   • Label Encoding, One hot Encoding, Dummy En...  

11. Data Visualisation with Python, Seaborn, Matplotlib
   • Data Visualisation with Python, Matplotlib...  

12. Feature Scaling in Machine Learning
   • Feature Scaling in Machine Learning  

13. Python 3 basics for Beginner
   • Python | Python 3 Basics | Python for Begi...  

14. Statistics with Python
   • Statistics with Python  

15. Sklearn Scikit Learn Machine Learning
   • Sklearn Scikit Learn Machine Learning  

16. Python Pandas Dataframe Operations
   • Python Pandas Dataframe Operations  

17. Linear Regression, Supervised Machine Learning
   • Linear Regression | Supervised Machine Lea...  


18 Interiew Questions on Machine Learning and Data Science
   • Interview Question for Machine Learning, D...  

19. Jupyter Notebook Operations
   • Jupyter and Spyder Notebook Operations in ...  


In questa pagina del sito puoi guardare il video online Convert Time Zones using Python pytz package | Python datetime package della durata di ore minuti seconda in buona qualità , che l'utente ha caricato technologyCult 01 giugno 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 2,932 volte e gli è piaciuto 24 spettatori. Buona visione!