Hi folks,
(Python 2.4.x - I cannot install any modules including dateutil)
Here's what I have so far.
mydate=['20111025.00', '20111026.12']
start_time= time.strptime(mydate[0], "%Y%m%d.%H")[:5]
end_time=time.strptime(mydate[1], "%Y%m%d.%H")[:5]
for myhour in datespan(time.strptime(mydate[0], "%Y%m%d.%H")[:4], time.strptime(mydate[1], "%Y%m%d.%H")[:4], delta=datetime.timedelta(hours=1)):
print myhour
What I'm trying to do is take the two values in mydate list - and show all hours inbetween the two values given. in the above example it would (or should) show.
20111025.00
20111025.01
20111025.02
...
20111026.12
Problem with the above code is it tells me.
can only concatenate tuple (not "datetime.timedelta") to tuple
Just can't make heads or tails out of it. Any suggestions?
Thank you.