I'm working in django, but standard python solution is ok too.
I'm converting a code which uses a naive-datetime to use aware-datetime.
Below is the original code:
today = datetime.today() MyClass.objects.filter(datetimefield__range=(today, today+datetime.timedelta(1)) ) How do I convert it to use timezone-aware time?
If the time is jun/3rd/7:20pm locally,
I'd like to get datetime range of [jun/3rd/00:00am, jun/4th/00:00am] (midnight to midnight which will include now)
dateutillibrary - labix.org/python-dateutilpytzout of the box, so why not stick with that?