Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
10331 Tampilan

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 .

Avatar
Buang
Jawaban Terbai

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..........

Avatar
Buang
Jawaban Terbai
from calender import monthrange
from datetime import date
mdays = monthrange(year,month)[1]
date2 = date(year,month,mdays)

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
Download Odoo 8 Diselesaikan
1
Mei 22
25588
0
Mar 17
4033
0
Nov 16
8286
2
Jan 16
5496
1
Des 23
21108