

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to set the first day of each week to weekday using Python?
You can set the first day of each week to weekday in Python. In the calender module there is a function, setfirstweekday() that helps you to set the first day of each week to the code of the weekday you provide to it. Note that setfirstweekday affects only display functions like prmonth.
Example
import calendar print(calendar.prmonth(2018, 1)) calendar.setfirstweekday(calendar.SUNDAY) print(calendar.prmonth(2018, 1))
Output
This will give the output −
January 2018 Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 January 2018 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- Related Questions & Answers
- How to get first day of the week using Python?
- How to set the first day of the week in sap.m.DatePicker's calendar?
- How to get first day of week in PHP?
- Java Program to get day of week for the last day of each month in 2019
- MySQL query to subtract date records with week day and display the weekday with records
- How to get the day of the week in JavaScript?
- How to get beginning of the first day of this week from timestamp in Android sqlite?
- Day of the Week in C++
- In MySQL, how we can compute date by providing the year, week number and day of the week? day of the week?
- Get the week number in MySQL for day of week?
- Display Day Name of Week using Java Calendar
- Formatting day of week using SimpleDateFormat in Java
- How to get day of month, day of year and day of week in android using offset date time API class?
- C# Program to get current day of week
- Java Program to get the day of the week from GregorianCalendar
Advertisements