Python简单语法入门三:日期处理

from datetime import datetime   //导入函数库

print datetime.now()   //打印当前日期
具体输出:2012-07-19 12:50:53.180759

获取时间:
now = datetime.now()
now.year
now.month
now.day
now.hour
now.minute
now.second

你可能感兴趣的:(python,日期)