Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Here you Go!
t_date = datetime.datetime.today()
num_of_day = 10 # This is different between two date range, you just find difference and use as numb_of_day
date_list = [base - datetime.timedelta(days=x) for x in range(0, num_of_day)]
print "Day List in Datetime Format:",date_list
This might help you,
fmt = '%Y-%m-%d'
d1 = datetime.strptime(from_date, fmt)
d2 = datetime.strptime(to_date, fmt)
dates_btwn = d1
while dates_btwn <= d2:
dates_btwn = dates_btwn + relativedelta.relativedelta(days=1)
This will display the dates between two dates..Hope this will help You..
use the following function, it is based on using the 'timedelta'
from datetime import datetime, timedelta
#show dates between two dates
def get_date_list(date1, date2):
date_list = 
loop_dt = date1
while loop_dt < date2:
loop_dt = loop_dt + timedelta(days=1)
get_date_list( datetime(2016,1,5), datetime(2016,03,5))
you can change it to return a list of dates
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
|Asked: 5/18/16, 2:11 AM|
|Seen: 355 times|
|Last updated: 1/19/17, 6:02 AM|