Python Programming: The Ultimate Beginners Guide to Master Python Programming Step-By-Step with Practical Exercises by Reed Mark

Python Programming: The Ultimate Beginners Guide to Master Python Programming Step-By-Step with Practical Exercises by Reed Mark

Author:Reed, Mark [Reed, Mark]
Language: eng
Format: epub
Published: 2020-05-11T16:00:00+00:00


>>> current_local_time= time.localtime()

>>> current_local_time.tm_zone

'E. Africa Standard Time'

The localtime () returns the East Africa Standard Time Zone. The tm_zone determines the local time zone of your system.

Example 2:

>>> import time

>>> current_local_time= time.localtime()

>>> current_local_time.tm_gmtoff

10800

>>> current_local_time.tm_isdst

0

The current local time is 10800 seconds behind the GMT. Greenwich Mean Time (GMT) is a time zone without UTC offset (UTC± 00:00).

You can convert the 10800seconds to GMT by dividing with seconds per hour (3600). Thus the local time GMT +03:00 which corresponds to UTC +03:00.

If you ignore the secs argument when calling the localtime() , it will return the current local time in struct_time.

Converting Local Time Object to Seconds

To convert the local time object to seconds, mktime() is used. Mktime() accepts parameter t which is in the form of a normal tuple with nine elements or a struct_time object.

>>> import time



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
Building Machine Learning Systems with Python by Richert Willi Coelho Luis Pedro(2066)
Hands-On Python Deep Learning for the Web by Anubhav Singh(1958)
Mastering OpenCV 4 with Python by Fernández Villán Alberto;(1834)
Building Serverless Python Web Services with Zappa by Abdulwahid Abdulhaque Barguzar(1711)
Mastering Python Data Visualization by Kirthi Raman(1649)
Python for Finance Cookbook by Eryk Lewinson(1642)
PYTHON PROGRAMMING ADVANCED: The Guide for Data Analysis and Data Science. Discover Machine Learning With the Optimum Recipes for Mastering Python and ... (Crash Course Tips and Tricks Book 3) by ERIC MATTHEWS & LEWIS TAYLOR(1636)
Python for Finance: Analyze Big Financial Data by Yves Hilpisch(1612)
Supervised Machine Learning with Python by Taylor Smith(1532)
Django 3 By Example by Antonio Melé(1519)
Interactive Data Visualization with Python by Anshu Kumar & Shubhangi Hora & Sharath Chandra Guntuku & Abha Belorkar(1366)
Hands-On GPU Programming with Python and CUDA by Dr. Brian Tuomanen(1290)
Python Feature Engineering Cookbook by Soledad Galli(1287)
Applied Deep Learning with Keras by Matthew Moocarme Mahla Abdolahnejad and Ritesh Bhagwat(1280)
Hands-On Image Processing with Python by Sandipan Dey(1257)
Scientific Computing with Python 3 by Claus Fuhrer & Jan Erik Solem & Olivier Verdier(1251)
Python Deep Learning. by Ivan Vasilev(1232)
Flask Framework Cookbook by Shalabh Aggarwal(1228)
Training Systems using Python Statistical Modeling by Curtis Miller(1190)
Django 3 Web Development Cookbook - Fourth Edition by Aidas Bendoraitis(1169)