-3
我想要做範圍(開始,結束)。我有天,例如python日期範圍列表元素
start date - end date ----------------------- 2015-05-17 - 2015-05-25 2015-06-10 - 2015-06-20 ----------------------- startdate = [datetime.date(2015, 5, 17), datetime.date(2015, 6, 10)] enddate = [datetime.date(2015, 5, 25), datetime.date(2015, 6, 20)] i need range startdate and enddate need_days = startdate[i] - enddate[i] 1. datetime.date(2015, 5, 25) - datetime.date(2015, 5, 17) 2. atetime.date(2015, 6, 20), datetime.date(2015, 6, 10) after i want range separate result ------------ 2015-05-17 2015-05-18 2015-05-19 2015-05-20 2015-05-21 2015-05-22 2015-05-23 2015-05-24 2015-05-25 result ---------- 2015-06-10 2015-06-11 2015-06-12 2015-06-13 2015-06-14 2015-06-15 2015-06-16 2015-06-17 2015-06-18 2015-06-19 2015-06-20
我該如何做到這一點?請幫助我,提前致謝。
你好兄弟,是的,我同意,這是事實,但我需要上述STARTDATE的exapmle = [datetime.date(2015,5,17),datetime.date(2015,6,10)] enddate = [datetime.date(2015,5,25),datetime.date(2015,6,20)] – PyDroid
我有開始日期(17,10)和結束日期(25,20)後我需要響e – PyDroid
我的輸出與您的輸出完全匹配,因此它如何不起作用? –