Answers for "datetime date with python"

19

python date and time

from datetime import datetime
now = datetime.now()
print (now.strftime("%Y-%m-%d %H:%M:%S"))


Output: 2020-06-19 10:34:45
Posted by: Guest on June-19-2020
0

python date and time to datetime

import datetime
datetime.datetime.combine(datetime.date(2011, 1, 1), 
                          datetime.time(10, 23))
Posted by: Guest on October-21-2021

Code answers related to "datetime date with python"

Python Answers by Framework

Browse Popular Code Answers by Language