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

Error: Hash Sum mismatch in GitLab

Recently, I have faced following error during instillation of Gitlab in Ubuntu. odedra@odedra-Lenovo-Z50-70:~$ sudo apt-get install gitla...