Python 时间 time
import time
print time.strftime("%Y-%m-%d")
import datetime print
datetime.datetime.now()
shell中 date '+%Y-%m-%d'
计算今天后的第N天?
import datetime
now = datetime.datetime.now()
delta = datetime.timedelta(days=3)
n_days = now + delta
print n_days.strftime('%Y-%m-%d %H:%M:%S')
输出:
2015-04-10 19:16:34