2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > [Python] Python获取当前年月日时分秒

[Python] Python获取当前年月日时分秒

时间:2022-08-14 20:18:43

相关推荐

[Python] Python获取当前年月日时分秒

美图欣赏/08/09

Python获取当前时间

import time# -08-09 16:43:35now_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())

Python获取当前时间的年月日时分秒

import datetime# datetime.datetime(, 8, 9, 16, 45, 22)today = datetime.datetime.today()# currentYear = today.year# 8currentMonth = today.month# 9currentDay = today.day# 16currentHour = today.hour# 45currentMinute = today.minute# 22currentSecond = today.second

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