ziheng - 时间与日历

import time
# local 本地的
t1 = time.localtime()
print(t1)
# 时间的格式化字符串
# 年 year 月 month 日 day 小时 hour 分钟 minute 秒 seconds 星期 week   wday week of day
print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
# print(t2)
t2 = time.localtime()
print(t2)
print(time.strftime("%H:%M", time.localtime()))
# 平时会看到的是时间: 小时:分钟



# isdst是否是夏令时:有些国家,为了省电在每年的4月至9月的时候
# 将时间统一调快一个小时,,,为了省电
# 1986-1992 中国实行过6年的

# str  int
# a = "3"  # str 字符串
# # a = int(a)
# b = 2    # int 数字
# b = str(b)
# print(a+b)





# calendar
import time
import calendar


print(time.localtime())
c1 = calendar.calendar(9012)
print(c1)
c2 = calendar.month(2020,3)
print(c2)
# 新建一个文件
f = open("日历.txt","w")
f.write(c1)
f.close()


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值