I want to print the current time in yyyy / mm / dd, hh: nn: ss format.
Reference http://docs.python.jp/2/library/datetime.html
http://ideone.com/bs3buK
test.py
import datetime
today = datetime.datetime.today()
yymmddhhnnss = today.strftime("%Y/%m/%d,%H:%M:%S")
print yymmddhhnnss
result
2015/12/01,03:44:30
It seems to be UTC because I ran it with ideone.
Recommended Posts