Answers for "1602750885000 to date and time python"

3

how to get the current date hour minute month year in python

########################################################################
import datetime
now = datetime.datetime.now()
print(now.year, now.month, now.day, now.hour, now.minute, now.second)
########################################################################
from datetime import *
now = datetime.now()
print(now.year, now.month, now.day, now.hour, now.minute, now.second)
########################################################################
Posted by: Guest on September-03-2020
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

Python Answers by Framework

Browse Popular Code Answers by Language