smoketest
is a datetime.datetime
object, not a string. What you see in print
is its string representation. datetime.datetime
object offers much more.
Do you need the smoketest
as date string and as time string? Use the strftime
method:
for smoketest in rrule.rrule(rrule.HOURLY, dtstart=startD, until=endD):
dateID = smoketest.strftime('%Y-%m-%d')
hourID = smoketest.strftime('%H:%M:%S')