300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > python 获取当前时间和日期

python 获取当前时间和日期

时间:2021-08-28 17:39:01

相关推荐

python 获取当前时间和日期

python 获取当前时间和日期

import timedef get_now_time():"""获取当前日期时间:return:当前日期时间"""now = time.localtime()now_time = time.strftime("%Y-%m-%d %H:%M:%S", now)# now_time = time.strftime("%Y-%m-%d ", now)return now_timeif __name__ == '__main__':now_time = get_now_time()print(now_time)

-03-05 15:32:14

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。