3/19/2021 0 Comments Short Time Calendars
This series provides actionable time management advice in just a few short minutes.Productivity expert Dave Crenshaw provides techniques on a wide variety of topics, designed to help people better manage their time and ultimately become more productive.
Short Time Calendars Series Provides ActionableTune in to learn about everything from managing emails and calendars to setting priorities, collaborating with coworkers, reducing interruptions, crafting a productivity mindset, and creating a more comfortable and effective work environment. Have an idea for a future video from Dave Submit it using our course feedback form. If you want more time management strategies now, we recommend watching Daves Time Management Fundamentals course. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. So, audit day is going to come back with whatever the day is for either the first or second week. On top of it, the TextCalendar and HTMLCalendar class in Python allows you to edit the calendar and use as per your requirement. Code Line 1: We begin with import calendar which will import all the classes of this module. Code Line 3: c calendar.TextCalendar(calendar.SUNDAY) tells the interpreter to create a text calendar. Lets quickly change the value from Sunday to Thursday and check the output Step 2) You can also print out the Calendar in HTML format, this feature is helpful for developer if they want to make any changes in the look and feel of calendar Step 3) Loops over the days of a month by using c.itermonthday (2025,4), it will fetch the total number of days for that month. Short Time Calendars Code To GetWhen you execute the code to get the total number of days for a specific month say April then you will get 30 days in the output but you will also see some zeros along with these days at the beginning and sometimes at the end of it. Zeros in the output mean that the day of the week is in an overlapping month, which means it does not belong to that month. These zeros appears in output because, in your code you have mentioned day (Thursday), so when you call function c.itermonthdays, it will start counting days from Thursday and your Thursday may not start with date 1 st of April it might be 28 th or 29 th of March, so when you execute the code it will start counting days from 28 th of march and any days after that till 1 st of April. These days will be counted as zero and in the output you will see these zeroes and same is applicable to the end of the month. So except date 1-30 all the dates from previous as well as post month will appear in the output as zeroes. Step 4) You can fetch the data from the local system, like months or weekdays, etc The output over here shows that we have printed out the months name from the local system. Likewise, you can also fetch the weekdays name as shown below The output will depend on the local system, suppose if your local system is some other countries then it will give the output as per the local settings of that country. Here we have months so it wont be a difference but if it is a week or day, it will certainly differ. Step 5) You can fetch the list of the specific day for a whole year. For example, there is an audit day on every first Monday of a week. You can use this code mycal calendar.monthcalendar(2025, month) will create calendar for the month Set variables week1 and week2 to the First and second week of the calendar Check if Week 1 contains Monday, set audit day Else set audit day as the first Monday in week 2 The output shows the date for the first Monday that falls in that month. The length of this Cal object is going to be a certain length, based on how many weeks there in the month. In our case, its going to be one or two as such first Monday of the week will be in the first week most often but if not then consider the second week. So, if in week one the day represented by the Monday constant is not equal to 0, remember zeros means days that belong to another month. So, in this case, if its zero, its going to be a Monday that belongs to the previous month. But if the first Monday is not equal to 0, that means that my audit day will be within the week one. So, then I say okay, set my audit day variable to be the Monday represented by Week two.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |