Odoo Help


get month from field

omar bahri
on 8/6/16, 6:40 AM 503 views

i have a model using fields that has date type, i try to get month from date but i can't

Sudhir Arya (SA)
On 8/7/16, 12:08 PM

You just have to use python datetime library.


from datetime import datetime
# Get month from your date
datetime.strftime(datetime.strptime(your_date_field, "%Y-%m-%d"), %m)

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: 8/6/16, 6:40 AM
Seen: 503 times
Last updated: 8/7/16, 12:08 PM