INADA Naoki added the comment:

akira:

It seems cleaner than utcfromtimestamp().replace().
I think utcfromtimestamp() should have note about it.

"""
Note that it returns **naive** (tz=None) datetime.  Naive datetime is
treated as localtime in most functions.
If you want to create aware datetime, use `.fromtimestamp(ts, tz=timezone.utc)` 
instead.
"""

And I want to add this note to docstring too, since I read docstring before
document.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22791>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to