Home > Mobile >  How can we get current date and time without using any module in PYTHON?
How can we get current date and time without using any module in PYTHON?

Time:02-01

I am doing this as a practice problem. Is there any way to get our current date and time without using datetime or any other module in python 3 ?

CodePudding user response:

No. If you don't want to use datetime, at minimum you still have to use time.

import time
current_time = time.ctime()
print(current_time)

Mon Jan 31 15:17:37 2022

CodePudding user response:

print(datetime.date(datetime.now()))

Hopefully that works

  •  Tags:  
  • Related