Post

PythonPython

A
Anand Sahu

Posted on 28th January 2023|28 views

0
votes

How to get the current time in Python

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

Answers
P
hari

Posted on 28th January 2023

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