Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
10387 Представления

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
25653
0
мар. 17
4065
0
нояб. 16
8316
2
янв. 16
5534
1
дек. 23
21165