Lets say that i have a duration of time e.g., 10 minutes . I have the start time and end time defined .
e.g., start time is 10 A.M and end time is 2 P.M .
I need the time intervals of
10-10.10 , 10.10 - 10.20 , .. , 10.50-11 etc.,
stored in the database .
Here is what i have in mind.
from datetime import datetime
time1 = '10:00'
time2 = '10.10'
format = '%H:%M'
obj1 = datetime.strptime(time1, format) - datetime.strptime(time2, format)
This is okay for two known intervals . What bout two unknown intervals and to store them in the database?
How can i solve this? Thanks.