Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Date and Time Module in Python | Edureka

334 views

Published on

YouTube Link: https://youtu.be/mHezNgNBnuA
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Date and Time in Python' will train you to use the datetime and time modules to fetch, set and modify date and time in python.
Below are the topics covered in this PPT:
The time module
Built-in functions
Examples
The datetime module
Built-in functions
Examples

Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Date and Time Module in Python | Edureka

  1. 1. ➢ The time module ➢ Built-in functions ➢ Examples ➢ Built-in functions ➢ Examples ➢ The datetime module www.edureka.co/python
  2. 2. www.edureka.co/python
  3. 3. www.edureka.co/python Function Description time() Returns the number of seconds ctime() Returns the current date and time sleep() Stops execution of a thread for the given duration localtime() Returns the date and time in time.struct_time format gmtime() Returns time.struct_time in UTC format mktime() Returns the seconds passed since epoch pas output asctime() Returns a string representing the same Begins recording time from the epoch that begins at 00:00:00, 1st Jan 1970
  4. 4. www.edureka.co/python Attribute Value tm_year 0000, .., 2019, …, 9999 tm_mon 1-12 tm_mday 1-31 tm_hour 0-23 tm_min 0-59 tm_sec 0-61 tm_wday 0-6, Monday as 0 tm_yday 1-366 tm_isdst 0, 1, -1 Attributes of struct_time class
  5. 5. www.edureka.co/python
  6. 6. www.edureka.co/python Function Description datetime() Datetime constructor datetime.today() Returns the current date and time datetime.now() Returns the current date and time date() Takes year, month and day as parameter and creates the corresponding date time() Takes hour, min, sec, microseconds and tzinfo as parameter and creates the corresponding date datetime.fromstamp() Converts seconds to return the corresponding date and time timedelta() It is the difference between different dates or times (Duration)
  7. 7. www.edureka.co/python

×