Answers for "import date and time in python"

2

import datetime

from datetime import datetime

date = datetime.now()
print(date)
# Prints in the format year, month, day, hour, minute, second, and microsecond
Posted by: Guest on February-15-2021
26

datetime python

from datetime import datetime as d
date = d.now()
print(date.strftime("%Y-%m-%d %H:%M:%S"))
Posted by: Guest on December-09-2020
8

datetime year python

import datetime
now = datetime.datetime.now()
print(now.year, now.month, now.day, now.hour, now.minute, now.second)
Posted by: Guest on May-12-2020

Code answers related to "import date and time in python"

Python Answers by Framework

Browse Popular Code Answers by Language