Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
e7827b94
Kaydet (Commit)
e7827b94
authored
Tem 11, 2014
tarafından
Corey Farwell
Kaydeden (comit)
Tim Graham
Tem 16, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Alphabetized django.utils sections.
üst
c62c480b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
114 additions
and
114 deletions
+114
-114
utils.txt
docs/ref/utils.txt
+114
-114
No files found.
docs/ref/utils.txt
Dosyayı görüntüle @
e7827b94
...
...
@@ -829,6 +829,120 @@ appropriate entities.
If ``value`` is ``"Joel is a slug"``, the output will be
``"joel-is-a-slug"``.
.. _time-zone-selection-functions:
``django.utils.timezone``
=========================
.. module:: django.utils.timezone
:synopsis: Timezone support.
.. data:: utc
:class:`~datetime.tzinfo` instance that represents UTC.
.. function:: get_fixed_timezone(offset)
.. versionadded:: 1.7
Returns a :class:`~datetime.tzinfo` instance that represents a time zone
with a fixed offset from UTC.
``offset`` is a :class:`datetime.timedelta` or an integer number of
minutes. Use positive values for time zones east of UTC and negative
values for west of UTC.
.. function:: get_default_timezone()
Returns a :class:`~datetime.tzinfo` instance that represents the
:ref:`default time zone <default-current-time-zone>`.
.. function:: get_default_timezone_name()
Returns the name of the :ref:`default time zone
<default-current-time-zone>`.
.. function:: get_current_timezone()
Returns a :class:`~datetime.tzinfo` instance that represents the
:ref:`current time zone <default-current-time-zone>`.
.. function:: get_current_timezone_name()
Returns the name of the :ref:`current time zone
<default-current-time-zone>`.
.. function:: activate(timezone)
Sets the :ref:`current time zone <default-current-time-zone>`. The
``timezone`` argument must be an instance of a :class:`~datetime.tzinfo`
subclass or, if pytz_ is available, a time zone name.
.. function:: deactivate()
Unsets the :ref:`current time zone <default-current-time-zone>`.
.. function:: override(timezone)
This is a Python context manager that sets the :ref:`current time zone
<default-current-time-zone>` on entry with :func:`activate()`, and restores
the previously active time zone on exit. If the ``timezone`` argument is
``None``, the :ref:`current time zone <default-current-time-zone>` is unset
on entry with :func:`deactivate()` instead.
.. function:: localtime(value, timezone=None)
Converts an aware :class:`~datetime.datetime` to a different time zone,
by default the :ref:`current time zone <default-current-time-zone>`.
This function doesn't work on naive datetimes; use :func:`make_aware`
instead.
.. function:: now()
Returns a :class:`~datetime.datetime` that represents the
current point in time. Exactly what's returned depends on the value of
:setting:`USE_TZ`:
* If :setting:`USE_TZ` is ``False``, this will be a
:ref:`naive <naive_vs_aware_datetimes>` datetime (i.e. a datetime
without an associated timezone) that represents the current time
in the system's local timezone.
* If :setting:`USE_TZ` is ``True``, this will be an
:ref:`aware <naive_vs_aware_datetimes>` datetime representing the
current time in UTC. Note that :func:`now` will always return
times in UTC regardless of the value of :setting:`TIME_ZONE`;
you can use :func:`localtime` to convert to a time in the current
time zone.
.. function:: is_aware(value)
Returns ``True`` if ``value`` is aware, ``False`` if it is naive. This
function assumes that ``value`` is a :class:`~datetime.datetime`.
.. function:: is_naive(value)
Returns ``True`` if ``value`` is naive, ``False`` if it is aware. This
function assumes that ``value`` is a :class:`~datetime.datetime`.
.. function:: make_aware(value, timezone)
Returns an aware :class:`~datetime.datetime` that represents the same
point in time as ``value`` in ``timezone``, ``value`` being a naive
:class:`~datetime.datetime`.
This function can raise an exception if ``value`` doesn't exist or is
ambiguous because of DST transitions.
.. function:: make_naive(value, timezone)
Returns an naive :class:`~datetime.datetime` that represents in
``timezone`` the same point in time as ``value``, ``value`` being an
aware :class:`~datetime.datetime`
.. _pytz: http://pytz.sourceforge.net/
``django.utils.translation``
============================
...
...
@@ -961,120 +1075,6 @@ For a complete discussion on the usage of the following see the
Session key under which the active language for the current session is
stored.
.. _time-zone-selection-functions:
``django.utils.timezone``
=========================
.. module:: django.utils.timezone
:synopsis: Timezone support.
.. data:: utc
:class:`~datetime.tzinfo` instance that represents UTC.
.. function:: get_fixed_timezone(offset)
.. versionadded:: 1.7
Returns a :class:`~datetime.tzinfo` instance that represents a time zone
with a fixed offset from UTC.
``offset`` is a :class:`datetime.timedelta` or an integer number of
minutes. Use positive values for time zones east of UTC and negative
values for west of UTC.
.. function:: get_default_timezone()
Returns a :class:`~datetime.tzinfo` instance that represents the
:ref:`default time zone <default-current-time-zone>`.
.. function:: get_default_timezone_name()
Returns the name of the :ref:`default time zone
<default-current-time-zone>`.
.. function:: get_current_timezone()
Returns a :class:`~datetime.tzinfo` instance that represents the
:ref:`current time zone <default-current-time-zone>`.
.. function:: get_current_timezone_name()
Returns the name of the :ref:`current time zone
<default-current-time-zone>`.
.. function:: activate(timezone)
Sets the :ref:`current time zone <default-current-time-zone>`. The
``timezone`` argument must be an instance of a :class:`~datetime.tzinfo`
subclass or, if pytz_ is available, a time zone name.
.. function:: deactivate()
Unsets the :ref:`current time zone <default-current-time-zone>`.
.. function:: override(timezone)
This is a Python context manager that sets the :ref:`current time zone
<default-current-time-zone>` on entry with :func:`activate()`, and restores
the previously active time zone on exit. If the ``timezone`` argument is
``None``, the :ref:`current time zone <default-current-time-zone>` is unset
on entry with :func:`deactivate()` instead.
.. function:: localtime(value, timezone=None)
Converts an aware :class:`~datetime.datetime` to a different time zone,
by default the :ref:`current time zone <default-current-time-zone>`.
This function doesn't work on naive datetimes; use :func:`make_aware`
instead.
.. function:: now()
Returns a :class:`~datetime.datetime` that represents the
current point in time. Exactly what's returned depends on the value of
:setting:`USE_TZ`:
* If :setting:`USE_TZ` is ``False``, this will be a
:ref:`naive <naive_vs_aware_datetimes>` datetime (i.e. a datetime
without an associated timezone) that represents the current time
in the system's local timezone.
* If :setting:`USE_TZ` is ``True``, this will be an
:ref:`aware <naive_vs_aware_datetimes>` datetime representing the
current time in UTC. Note that :func:`now` will always return
times in UTC regardless of the value of :setting:`TIME_ZONE`;
you can use :func:`localtime` to convert to a time in the current
time zone.
.. function:: is_aware(value)
Returns ``True`` if ``value`` is aware, ``False`` if it is naive. This
function assumes that ``value`` is a :class:`~datetime.datetime`.
.. function:: is_naive(value)
Returns ``True`` if ``value`` is naive, ``False`` if it is aware. This
function assumes that ``value`` is a :class:`~datetime.datetime`.
.. function:: make_aware(value, timezone)
Returns an aware :class:`~datetime.datetime` that represents the same
point in time as ``value`` in ``timezone``, ``value`` being a naive
:class:`~datetime.datetime`.
This function can raise an exception if ``value`` doesn't exist or is
ambiguous because of DST transitions.
.. function:: make_naive(value, timezone)
Returns an naive :class:`~datetime.datetime` that represents in
``timezone`` the same point in time as ``value``, ``value`` being an
aware :class:`~datetime.datetime`
.. _pytz: http://pytz.sourceforge.net/
``django.utils.tzinfo``
=======================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment