On this page
calendar.Day
Prev: calendar.Calendar | Up: calendar | Next: calendar.firstweekday
Rel: calendar.calendar, calendar.Calendar, calendar.firstweekday, calendar.HTMLCalendar
Ref: docs.python.org — calendar.Day
Tags: #public #python3 #stdlib #calendar
Import
import calendar
from calendar import Day
Signature & Overview
calendar.Day(*values)
calendar.Day class.
Methods & Attributes
Day.as_integer_ratio(self, /)— Return a pair of integers, whose ratio is equal to the original int.Day.bit_count(self, /)— Number of ones in the binary representation of the absolute value of self.Day.bit_length(self, /)— Number of bits necessary to represent self in binary.Day.conjugate(self, /)— Returns self, the complex conjugate of any int.Day.from_bytes(bytes, byteorder='big', *, signed=False)— Return the integer represented by the given array of bytes.Day.is_integer(self, /)— Returns True. Exists for duck type compatibility with float.is_integer.Day.to_bytes(self, /, length=1, byteorder='big', *, signed=False)— Return an array of bytes representing an integer.
Usage
import calendar
assert calendar.Day.MONDAY == 0 and calendar.Day.SUNDAY == 6
Gotchas
- Requires Python 3.12+ (
IntEnum): Monday is0, Sunday is6(matchingdate.weekday()).
REPL Inspect
from calendar import Day
help(Day)
Linked from
- tuts/python3/stdlib_module/calendar
- tuts/python3/stdlib_module/calendar/calendar
- tuts/python3/stdlib_module/calendar/Calendar_class
- tuts/python3/stdlib_module/calendar/firstweekday
- tuts/python3/stdlib_module/calendar/HTMLCalendar
- tuts/python3/stdlib_module/calendar/IllegalMonthError
- tuts/python3/stdlib_module/calendar/IllegalWeekdayError
- tuts/python3/stdlib_module/calendar/isleap
- tuts/python3/stdlib_module/calendar/leapdays
- tuts/python3/stdlib_module/calendar/LocaleHTMLCalendar
- tuts/python3/stdlib_module/calendar/LocaleTextCalendar
- tuts/python3/stdlib_module/calendar/month
- tuts/python3/stdlib_module/calendar/Month_class
- tuts/python3/stdlib_module/calendar/monthcalendar
- tuts/python3/stdlib_module/calendar/monthrange
- tuts/python3/stdlib_module/calendar/prcal
- tuts/python3/stdlib_module/calendar/prmonth
- tuts/python3/stdlib_module/calendar/setfirstweekday
- tuts/python3/stdlib_module/calendar/TextCalendar
- tuts/python3/stdlib_module/calendar/timegm
- tuts/python3/stdlib_module/calendar/weekday
- tuts/python3/stdlib_module/calendar/weekheader
Related notes
- tuts/python3/stdlib_module/calendar/calendar Linked here; links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/Calendar_class Linked here; links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/firstweekday Linked here; links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/HTMLCalendar Linked here; links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/IllegalMonthError links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/IllegalWeekdayError links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/isleap links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/leapdays links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/LocaleHTMLCalendar links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/LocaleTextCalendar links to this page; shared tags: #calendar, #stdlib