Wednesday, 11 May 2016

How to find last day of current month in Python ?

For finding last day of current month, we need to use calendar and datetime python libraries.

Following is an example of it.

>>> import calendar
>>> import datetime

>>> calendar.mdays[datetime.date.today().month]
31

I hope you like this article. Share your views to improve content. Happy Learning !!!

No comments:

Post a Comment

ImportError: No module named googleapiclient

Recently, I have faced ImportError: No module named googleapiclient and I would like to share knowledge to fix that problem. Open termina...