2020-10-31
阅读量:
855
Python写函数求今天日期getCurrentDate
###定义一个函数,求今天日期。
import time
def getCurrentDate():
strDate = time.strftime('%Y-%m-%d', time.localtime(time.time())) #这里格式是‘%Y-%m-%d’,可有其他格式,也可只求年和月。
return strDate
today = getCurrentDate()






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论