Odoo Help


Date Modification

on 12/16/14, 2:19 AM 1,245 views

How to increase or decrease the current date (code in python file) ?

Please make the question more clear and detailed. In the case date, there is a large area to explain, so more specific, and exact need too. Thanks

on 6/7/17, 2:00 AM

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
| 5 5 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 12/16/14, 2:33 AM

You could use TIMEDELTA to increase or decrease date value.

from datetime import datetime, timedelta
print (datetime.today() + timedelta(days=(1))).strftime('%Y-%m-%d')    // for next day
print (datetime.today() + timedelta(days=(-1))).strftime('%Y-%m-%d')    // for previous day

For more info: https://docs.python.org/2/library/datetime.html#timedelta-objects

ok, thanks you mr. Atchuthan

on 6/7/17, 1:52 AM

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: 12/16/14, 2:19 AM
Seen: 1245 times
Last updated: 6/7/17, 2:18 AM