Date/time commit options
We currently have the utc_timestamp
option. It has the advantage of being very explicit, but isn't the most practical.
We should add two new options (using the recent extensibility of such options) for the easier to create datetime
objects.
Avoiding time zone ambiguity is crucial to spare people of the future those hairy random breakages one can get when suddenly a time zone changes (daylight savings, other unforeseen side effects)
-
utc_datetime
: takes a naivedatetime
instance and interprets it as UTC. Perhaps accept explicit UTC timezone for convenience, but refuses everything else. -
tz_datetime
or perhaps justdatetime
: takes adatetime
instance with explicit time zone. The time zone is mandatory,ValueError
is raised if missing.