calendar模块

常见函数及说明

1 calendar.calendar(year,w=2,l=1,c=6)
   返回一个多行字符串格式的year年年历,3个月一行,间隔距离为c。 每日宽度间隔为w字符。每行长度为21* W+18+2* C。l是每星期行数。

2 calendar.firstweekday( )
   返回当前每周起始日期的设置。默认情况下,首次载入caendar模块时返回0,即星期一。

3 calendar.isleap(year)

是闰年返回True,否则为false。

4 calendar.leapdays(y1,y2)
  返回在Y1,Y2两年之间的闰年总数。

5 calendar.month(year,month,w=2,l=1)
   返回一个多行字符串格式的year年month月日历,两行标题,一周一行。每日宽度间隔为w字符。每行的长度为7* w+6。l是每星期的行数。

6 calendar.monthcalendar(year,month)
   返回一个整数的单层嵌套列表。每个子列表装载代表一个星期的整数。Year年month月外的日期都设为0;范围内的日子都由该月第几日表示,从1开始。

7 calendar.monthrange(year,month)
   返回两个整数。第一个是该月的星期几的日期码,第二个是该月的日期码。日从0(星期一)到6(星期日);月从1到12。

8 calendar.prcal(year,w=2,l=1,c=6)
   相当于 print calendar.calendar(year,w,l,c).

9 calendar.prmonth(year,month,w=2,l=1)
   相当于 print calendar.calendar(year,w,l,c)。

10 calendar.setfirstweekday(weekday)
     设置每周的起始日期码。0(星期一)到6(星期日)。

11 calendar.timegm(tupletime)
     和time.gmtime相反:接受一个时间元组形式,返回该时刻的时间辍(1970纪元后经过的浮点秒数)。

12 calendar.weekday(year,month,day)
     返回给定日期的日期码。0(星期一)到6(星期日)。月份为 1(一月) 到 12(12月)。

Python学习总结16:时间模块datetime & time & calendar (三)的更多相关文章

  1. Python学习总结15:时间模块datetime & time & calendar (二)

    二 .datetime模块  1. datetime中常量 1)datetime.MINYEAR,表示datetime所能表示的最小年份,MINYEAR = 1. 2)datetime.MAXYEAR ...

  2. Python学习总结14:时间模块datetime & time & calendar (一)

    Python中的常用于处理时间主要有3个模块datetime模块.time模块和calendar模块. 一.time模块 1. 在Python中表示时间的方式 1)时间戳(timestamp):通常来 ...

  3. 【转载】Python日期时间模块datetime详解与Python 日期时间的比较,计算实例代码

    本文转载自脚本之家,源网址为:https://www.jb51.net/article/147429.htm 一.Python中日期时间模块datetime介绍 (一).datetime模块中包含如下 ...

  4. Python时间模块datetime用法

    时间模块datetime是python内置模块,datetime是Python处理日期和时间的标准库. 1,导入时间模块 from datetime import datetime 2,实例 from ...

  5. [Python] Python学习笔记之常用模块总结[持续更新...]

    作为一种极其简单的编程语言,Python目前成为了最炙手可热的几种语言之一.它不仅简单易学,而且它还为用户提供了各种各样的模块,功能强大,无所不能.有利必有弊,学习Python同样有困扰,其中之一就是 ...

  6. Python学习笔记:time模块和datetime模块(时间和日期)

    time模块 time模块通常用来操作时间戳信息(各种“秒”),常用的方法有: time.sleep(seconds):将当前程序阻塞指定秒数,然后继续运行程序. time.time():返回当前时间 ...

  7. python时间模块datetime

    datetime模块 datetime在python中比较常用,主要用来处理时间日期,使用前先倒入datetime模块.下面总结下本人想到的几个常用功能. 1.当前时间(日期.小时.字符串时....) ...

  8. Python学习笔记5-时间模块time/datetime

    import time time.sleep(2) #等待几秒 # 1.格式化好的时间 2018-1-14 16:42 # 2.时间戳 是从unix元年到现在所有的秒数 # 3.时间元组 #想时间戳和 ...

  9. python第十七天---时间模块、random模块

    作完一个作业,开始新的学习: 有由今天的时间有限所有学习了以下两个模块,明天继续! 时间模块.random模块 import time #!usr/bin/env python #-*-coding: ...

随机推荐

  1. 【转】Unity利用WWW http传输Json数据

    http://blog.csdn.net/h570768995/article/details/50386935 首先去下载LitJson.dll,放在Plugins 目录下: LitJson可以从下 ...

  2. 文件对比工具Beyond Compare使用方法

    今天向大家介绍一个使用起来十分方便且功能十分强大的文件对比工具-Beyond Compare. 1    工具下载 工具的下载很简单,百度搜索Beyond Compare即可. 下载完成后,解压缩,双 ...

  3. Oracle客户端显示乱码解决

    1.查找当前服务器的字符集: 2.使用查询得到的结果集,设置本地local字符集:(不要照抄图片)

  4. magento cache,magento index

    "Magento后台作修改,Magento前台没变化""Magento属性更新了,Magento前台没反应"如果你碰到了以上两种情况,或者看到截图中的提示: 您 ...

  5. [LeetCode]题解(python):061-Rotate list

    题目来源 https://leetcode.com/problems/rotate-list/ Given a list, rotate the list to the right by k plac ...

  6. jquery在线手册

    开发时用到jquery,有几个函数想不起来怎么用,找了一下jquery在线手册. 记录一下,下回有需要再看看. 链接:http://www.chenfahui.cn/jq/

  7. OrderSessionHelper查看订单在session是否存在的辅助类

    1. package com.biotool.web.controller.helper; import org.apache.commons.lang3.StringUtils; import ja ...

  8. 最近在用mvc3开发时遇到的一些小问题与解决方法....

    问题一:控制器中的字符串如何显示在view的javascript中?例如ViewBag.str="1,2,3,4,5"; 解决办法:例如:<script type=" ...

  9. AJAX中UPDATEPANEL配合TIMER控件实现局部无刷新

    首先加入UpdatePanel <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode= ...

  10. 苹果公司给出的检测 advertisingIdentifier 的方法

    To locate the reference to the advertisingIdentifier selector, please perform these steps to create ...