vnpy/vn.training/day_test.py

17 lines
376 B
Python
Raw Normal View History

2015-10-23 17:12:08 +00:00
# encoding: UTF-8
import datetime
startDate = datetime.date(2012,6,1)
endDate = datetime.date(2012,12,31)
for i in range (0,(endDate - startDate).days +1, 10):
d1 = startDate + datetime.timedelta(days= i )
if (endDate - d1).days > 10:
d2 = startDate + datetime.timedelta(days= i+9 )
else:
d2 = endDate
i = i + 10
print str(d1),str(d2)