Odoo Help

Welcome!

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

0

How to get last day of month in openerp?

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

--Baiju--
3154
| 5 4 8
Kochi, India
--Baiju--
ODOO technical and functional

        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
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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