Answers for "how to create a datetime object in python"

25

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
0

how to create a datetime object in python

import datetime

date = datetime.datetime(2/9/2021)
print(x)
Posted by: Guest on September-02-2021

Code answers related to "how to create a datetime object in python"

Python Answers by Framework

Browse Popular Code Answers by Language