Kaydet (Commit) d60386d0 authored tarafından Tim Graham's avatar Tim Graham Kaydeden (comit) GitHub

Fixed #26571 -- Corrected recommendation for converting timestamps to tz-aware datetimes.

üst 4f138fe5
......@@ -151,10 +151,8 @@ used.
backwards-compatibility with applications that still rely on local time.
However, :ref:`as explained above <naive-datetime-objects>`, this isn't
entirely reliable, and you should always work with aware datetimes in UTC
in your own code. For instance, use
:meth:`~datetime.datetime.utcfromtimestamp` instead of
:meth:`~datetime.datetime.fromtimestamp` -- and don't forget to set
``tzinfo`` to :data:`~django.utils.timezone.utc`.
in your own code. For instance, use :meth:`~datetime.datetime.fromtimestamp`
and set the ``tz`` parameter to :data:`~django.utils.timezone.utc`.
Selecting the current time zone
-------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment