On Tue, Aug 25, 2015 at 4:13 PM, Carl Meyer <[email protected]> wrote:
> You are missing the crux of my use case, which is that I need to
> generate a calendar to display to the user, with all the half-hour slots
> from midnight to midnight for one day in it
>
Got it. How is this then
start = datetime.combine(date, time(0)).astimezone()
while True:
end = (start + timedelta(hours=0.5)).astimezone()
print(start, end)
start = end
if end.time() == time(0):
break
_______________________________________________
Datetime-SIG mailing list
[email protected]
https://mail.python.org/mailman/listinfo/datetime-sig
The PSF Code of Conduct applies to this mailing list:
https://www.python.org/psf/codeofconduct/