Both behaviors are documented and &quot;if not midnight&quot; adds a fair bit of complexity, probably a good idea to know exactly what happens when you write that.<p>[1] <a href="https:&#x2F;&#x2F;docs.python.org&#x2F;2&#x2F;library&#x2F;stdtypes.html#truth-value-testing" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;2&#x2F;library&#x2F;stdtypes.html#truth-value-...</a><p>[2] <a href="https:&#x2F;&#x2F;docs.python.org&#x2F;2&#x2F;library&#x2F;datetime.html#time-objects" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;2&#x2F;library&#x2F;datetime.html#time-objects</a>