Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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
cpython
Commits
b39a0c24
Kaydet (Commit)
b39a0c24
authored
Haz 15, 2010
tarafından
Alexander Belopolsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 5094: minor documentation fixes
üst
05cc2030
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
datetime.rst
Doc/library/datetime.rst
+22
-22
datetimemodule.c
Modules/datetimemodule.c
+3
-3
No files found.
Doc/library/datetime.rst
Dosyayı görüntüle @
b39a0c24
...
...
@@ -1351,7 +1351,7 @@ methods. Exactly which methods are needed depends on the uses made of aware
:mod:`datetime` objects. If in doubt, simply implement all of them.
.. method:: tzinfo.utcoffset(
self,
dt)
.. method:: tzinfo.utcoffset(dt)
Return offset of local time from UTC, in minutes east of UTC. If local time is
west of UTC, this should be negative. Note that this is intended to be the
...
...
@@ -1373,7 +1373,7 @@ methods. Exactly which methods are needed depends on the uses made of aware
:exc:`NotImplementedError`.
.. method:: tzinfo.dst(
self,
dt)
.. method:: tzinfo.dst(dt)
Return the daylight saving time (DST) adjustment, in minutes east of UTC, or
``None`` if DST information isn't known. Return ``timedelta(0)`` if DST is not
...
...
@@ -1421,7 +1421,7 @@ methods. Exactly which methods are needed depends on the uses made of aware
The default implementation of :meth:`dst` raises :exc:`NotImplementedError`.
.. method:: tzinfo.tzname(
self,
dt)
.. method:: tzinfo.tzname(dt)
Return the time zone name corresponding to the :class:`datetime` object *dt*, as
a string. Nothing about string names is defined by the :mod:`datetime` module,
...
...
@@ -1457,7 +1457,7 @@ time, and not need worry about objects in other timezones.
There is one more :class:`tzinfo` method that a subclass may wish to override:
.. method:: tzinfo.fromutc(
self,
dt)
.. method:: tzinfo.fromutc(dt)
This is called from the default :class:`datetime.astimezone()` implementation.
When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time members
...
...
@@ -1553,46 +1553,46 @@ changes have been made to civil time.
.. class:: timezone(offset[, name])
The
``offset``
argument must be specified as a :class:`timedelta`
The
*offset*
argument must be specified as a :class:`timedelta`
object representing the difference between the local time and UTC. It must
be
within the range [``-timedelta(hours=23, minutes=59),
``timedelta(hours=2
3, minutes=59)``] and represent
whole number of minutes,
be
strictly between ``-timedelta(hours=24)`` and
``timedelta(hours=2
4)`` and represent a
whole number of minutes,
otherwise :exc:`ValueError` is raised.
The
``name``
argument is optional. If specified it must be a string that
used as the value returned by the ``tzname(dt)`` method. Otherwise,
The
*name*
argument is optional. If specified it must be a string that
is
used as the value returned by the ``tzname(dt)`` method. Otherwise,
``tzname(dt)`` returns a string 'UTCsHH:MM', where s is the sign of
``offset``
, HH and MM are two digits of ``offset.hours`` and
*offset*
, HH and MM are two digits of ``offset.hours`` and
``offset.minutes`` respectively.
.. method:: timezone.utcoffset(
self,
dt)
.. method:: timezone.utcoffset(dt)
Return
s
the fixed value specified when the :class:`timezone` instance is
constructed. The
``dt``
argument is ignored. The return value is a
Return the fixed value specified when the :class:`timezone` instance is
constructed. The
*dt*
argument is ignored. The return value is a
:class:`timedelta` instance equal to the difference between the
local time and UTC.
.. method:: timezone.tzname(
self,
dt)
.. method:: timezone.tzname(dt)
Return
s
the fixed value specified when the :class:`timezone` instance is
Return the fixed value specified when the :class:`timezone` instance is
constructed or a string 'UTCsHH:MM', where s is the sign of
``offset``
, HH and MM are two digits of ``offset.hours`` and
``offset.minutes`` respectively.
The ``dt`` argument is ignored.
*offset*
, HH and MM are two digits of ``offset.hours`` and
``offset.minutes`` respectively.
.. method:: timezone.dst(
self,
dt)
.. method:: timezone.dst(dt)
Always returns ``None``.
.. method:: timezone.fromutc(
self,
dt)
.. method:: timezone.fromutc(dt)
Return
s ``dt + offset``. The ``dt`` argument must be aware with ``tzinfo``
set to ``self``.
Return
``dt + offset``. The *dt* argument must be an aware
:class:`datetime` instance, with ``tzinfo``
set to ``self``.
Class attributes:
.. attribute:: timezone.utc
The UTC timezone, ``timezone(
0, 'UTC'
)``.
The UTC timezone, ``timezone(
timedelta(0)
)``.
.. _strftime-strptime-behavior:
...
...
Modules/datetimemodule.c
Dosyayı görüntüle @
b39a0c24
...
...
@@ -3472,13 +3472,13 @@ timezone_fromutc(PyDateTime_TimeZone *self, PyDateTime_DateTime *dt)
static
PyMethodDef
timezone_methods
[]
=
{
{
"tzname"
,
(
PyCFunction
)
timezone_tzname
,
METH_O
,
PyDoc_STR
(
"If name is specified when timezone is created, returns the name."
" Otherwise returns offset as 'UTC(+|-)HHMM'."
)},
" Otherwise returns offset as 'UTC(+|-)HH
:
MM'."
)},
{
"utcoffset"
,
(
PyCFunction
)
timezone_utcoffset
,
METH_O
,
PyDoc_STR
(
"Return
s fixed offset. Ignores its argumen
t."
)},
PyDoc_STR
(
"Return
fixed offse
t."
)},
{
"dst"
,
(
PyCFunction
)
timezone_dst
,
METH_O
,
PyDoc_STR
(
"Return
s None. Ignores its argument
."
)},
PyDoc_STR
(
"Return
None
."
)},
{
"fromutc"
,
(
PyCFunction
)
timezone_fromutc
,
METH_O
,
PyDoc_STR
(
"datetime in UTC -> datetime in local time."
)},
...
...
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