python - Is there an object that compares smaller than any valid datetime.datetime(...)? -
is there min
constant datetime
?
i need represent expiration date of resource, , want have datetime
represents "always expires" default value (instead of none
can use same expiration comparison no matter what).
so right i'm using datetime.datetime(datetime.minyear,1,1,0,0,tzusc())
min datetime
wonder if there other way represents "the lowest possible time" (even if it's not datetime
).
you can try - datetime.datetime.min
. according documentation -
datetime.min
the earliest representable datetime, datetime(minyear, 1, 1, tzinfo=none).
Comments
Post a Comment