44 Views

19th April 2020

How to get the current time in Python

What is the module/method used to get the current time?

Answers

20th April 2020

Answered by test hari

Use Below Code:

>>> Import Datetime
>>> Datetime.datetime.now()
Datetime.datetime(2020, 2, 18, 21, 20, 48, 62458)

>>> Print(datetime.datetime.now())
2020-02-18 21:20:48.624580

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos