Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
10448 Переглядів

I do not know how to get Last day of specific month . please I need helping  you to me for that .

Thank you for you .

Аватар
Відмінити
Найкраща відповідь

Hi,

first you have to import calender

and you can use monthrange() method.

monthrange(year, month)
    Returns weekday of first day of the month and number of days in month, for the specified year and month. 

for getting the last day of a month you can use this script:-

calendar.monthrange(year, month)[1] 


Hope this helps..........

Аватар
Відмінити
Найкраща відповідь
from calender import monthrange
from datetime import date
mdays = monthrange(year,month)[1]
date2 = date(year,month,mdays)

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
Download Odoo 8 Вирішено
1
трав. 22
25861
0
бер. 17
4166
0
лист. 16
8355
2
січ. 16
5591
1
груд. 23
21253