Dealing with naive datetime objects #138
Labels
discussion
There are several possible ways to resolve this issue that need a discussion
enhancement
New feature or request
Passing a naive
datetime
object toTimestamp.from_datetime
currently leads to:Now passing naive objects may be dangerous. And maybe we don't want this. That we need to discuss. I see the following options
datetime
objects infrom_datetime
. In accordance withdatetime.timestamp()
, assume that naive datetime instances represent local time and use the appropriate mechanisms indatetime
.from_datetime
, but provide a slightly clearer error.from_naive_datetime
which still allows it, but is more explicit to not make silent mis-assumptionsI tend to the latter variant, but it also bloats up the API somewhat.
I'm currently using
which is less than ideal.
Note: the current documentation is already clear, that aware objects are expected.
The text was updated successfully, but these errors were encountered: