Advanced Tenth Lesson Python module calendar

Source: Internet
Author: User
Tags string format

Calendar, which is a module related to calendars. There are many types defined in the Calendar module file, mainly Calendar,textcalendar and Htmlcalendar types. The calendar is the base class for Textcalendar and Htmlcalendar. The module file also provides a number of methods, such as: Calendar,month,prcal,prmonth.

You can see this link:

Https://www.cnblogs.com/keqipu/p/7228502.html

Calendar.calendar (year,w=2,l=1,c=6)
Returns the year calendar of a multi-line string format with a 3-month line with a distance of C. The daily width interval is w characters. The length of each line is 21*w+18+2* C. L is the number of rows per week.

Calendar.firstweekday ()
Returns the settings for the current weekly start date. By default, 0 is returned when the Caendar module is first loaded, which is Monday.

Calendar.isleap (year)
is a leap year that returns true, otherwise false.

Calendar.leapdays (Y1,y2)
Returns the total number of leap years between y1,y2 two.

Calendar.month (year,month,w=2,l=1)
Returns a multi-line string format for year month calendar, two row headings, and one week row. The daily width interval is w characters. The length of each line is 7* w+6. L is the number of rows per week.

Calendar.monthcalendar (Year,month)
Returns a single-level nested list of integers. Each sub-list is loaded with integers representing one weeks. The date of year month is set to 0, and the day of the month is indicated by the day of the week, starting from 1.

Calendar.monthrange (Year,month)
Returns a two integer. The first is the day of the week of the month, and the second is the date code for that month. Day from 0 (Monday) to 6 (Sunday); The month is from 1 to 12.

Calendar.prcal (year,w=2,l=1,c=6)
Equivalent to Printcalendar.calendar (YEAR,W,L,C).

Calendar.prmonth (year,month,w=2,l=1)
Equivalent to Printcalendar.calendar (YEAR,W,L,C).

Calendar.setfirstweekday (Weekday)
Set the starting date code for the week. 0 (Monday) to 6 (Sunday).

CALENDAR.TIMEGM (Tupletime)
In contrast to Time.gmtime: accepts a time tuple form, returning the time suffix (the number of floating-point seconds elapsed after the 1970 era).

Calendar.weekday (Year,month,day)
Returns the date code for the given date. 0 (Monday) to 6 (Sunday). Month is 1 (January) to 12 (December)

Advanced Tenth Lesson Python module calendar

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.