python3 yyyymmddhhmmss

Solutions on MaxInterview for python3 yyyymmddhhmmss by the best coders in the world

showing results for - "python3 yyyymmddhhmmss"
Angela
06 Jan 2020
1import datetime
2 
3currentDT = datetime.datetime.now()
4 
5print (currentDT.strftime("%Y-%m-%d %H:%M:%S"))
6print (currentDT.strftime("%Y/%m/%d"))
7print (currentDT.strftime("%H:%M:%S"))
8print (currentDT.strftime("%I:%M:%S %p"))
9print (currentDT.strftime("%a, %b %d, %Y"))
10