xingtai - 时间

import time
# local 本地的,当地的
t1 = time.localtime()
print(t1)
print(time.strftime(" %H:%M",time.localtime()))
print(time.strftime("%Y-%m-%d %w %H %M %S "))
# year 年份  month 月份  day日  hour 小时 minute 分钟 seconds秒
# wday: week of day  1.8天   yday  year of day 91
# isdst 是否夏令时


# 有些国家 4月份到9月份  全国人调快手表和时钟1个小时
# 电  早1个小时睡觉  节省资源
# 1986年-1992年 6年 资源 电力

# 格式字符串,%d代替整数   %s代替字符串 str  --string
# 时间的格式化字符串


# 日历 calendar
import calendar

c1 = calendar.calendar(9012)
print(c1)

发布了530 篇原创文章 · 获赞 21 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/houlaos/article/details/105230926
今日推荐