Since I want to get the last Wendnesday of every month, use pendulum.parse but sometimes 4 is last week or 5 is last week. How to get easily the day is last Wendnesday of month or not?
Asked
Active
Viewed 107 times
1 Answers
-1
You can use the calendar module from the standard library and compute all dates
calendar.weekday(year, month, day) Returns the day of the week (0 is Monday) for year (1970–…), month (1–12), day (1–31).
As a helper, you can also use from the same module
calendar.monthrange(year, month) Returns weekday of first day of the month and number of days in month, for the specified year and month.

Raspberry PyCharm
- 104
- 1
- 4
-
 Uhm..My Question is lame. I wanna know this Wendnes day is last or not, Thank you for ur Answer. I have to think more :) – Ethan Jun 16 '21 at 16:46