Odoo Help


How to get last day of month in openerp?

Mohammed Khamis
on 5/3/15, 9:01 AM 2,176 views

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 .


Baiju KS

--Baiju KS--
| 5 5 8
Kochi, India
--Baiju KS--
ODOO technical

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju KS
On 5/3/15, 1:34 PM


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

sameer alhwety
On 5/4/15, 2:56 AM
from calender import monthrange
from datetime import date
mdays = monthrange(year,month)[1]
date2 = date(year,month,mdays)

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/3/15, 9:01 AM
Seen: 2176 times
Last updated: 5/4/15, 3:02 AM