Answers for "python3 yyyymmddhhmmss"

0

python3 yyyymmddhhmmss

import datetime
 
currentDT = datetime.datetime.now()
 
print (currentDT.strftime("%Y-%m-%d %H:%M:%S"))
print (currentDT.strftime("%Y/%m/%d"))
print (currentDT.strftime("%H:%M:%S"))
print (currentDT.strftime("%I:%M:%S %p"))
print (currentDT.strftime("%a, %b %d, %Y"))
Posted by: Guest on February-04-2020

Python Answers by Framework

Browse Popular Code Answers by Language