Odoo Help

0

How to get last day of month in openerp?

By
Mohammed Khamis
on 5/3/15, 9:01 AM 1,202 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 .

0

Baiju KS

--Baiju KS--
Baiju KS
3194
| 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

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

0
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)

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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.

Register

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)

Stats

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