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
085556ae
Kaydet (Commit)
085556ae
authored
Ock 10, 2011
tarafından
Alexander Belopolsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improved description of %Y directive.
üst
262cc7f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
datetime.rst
Doc/library/datetime.rst
+16
-7
No files found.
Doc/library/datetime.rst
Dosyayı görüntüle @
085556ae
...
@@ -1661,10 +1661,6 @@ version) requires, and these work on all platforms with a standard C
...
@@ -1661,10 +1661,6 @@ version) requires, and these work on all platforms with a standard C
implementation. Note that the 1999 version of the C standard added additional
implementation. Note that the 1999 version of the C standard added additional
format codes.
format codes.
The exact range of years for which :meth:`strftime` works also varies
across platforms. Regardless of platform, years before 1000 cannot be
used with ``datetime`` module ``strftime()`` methods.
+-----------+--------------------------------+-------+
+-----------+--------------------------------+-------+
| Directive | Meaning | Notes |
| Directive | Meaning | Notes |
+===========+================================+=======+
+===========+================================+=======+
...
@@ -1737,10 +1733,11 @@ used with ``datetime`` module ``strftime()`` methods.
...
@@ -1737,10 +1733,11 @@ used with ``datetime`` module ``strftime()`` methods.
| ``%y`` | Year without century as a | |
| ``%y`` | Year without century as a | |
| | decimal number [00,99]. | |
| | decimal number [00,99]. | |
+-----------+--------------------------------+-------+
+-----------+--------------------------------+-------+
| ``%Y`` | Year with century as a decimal | |
| ``%Y`` | Year with century as a decimal | \(5) |
| | number. | |
| | number [0001,9999] (strptime), | |
| | [1000,9999] (strftime). | |
+-----------+--------------------------------+-------+
+-----------+--------------------------------+-------+
| ``%z`` | UTC offset in the form +HHMM | \(
5
) |
| ``%z`` | UTC offset in the form +HHMM | \(
6
) |
| | or -HHMM (empty string if the | |
| | or -HHMM (empty string if the | |
| | the object is naive). | |
| | the object is naive). | |
+-----------+--------------------------------+-------+
+-----------+--------------------------------+-------+
...
@@ -1772,6 +1769,18 @@ Notes:
...
@@ -1772,6 +1769,18 @@ Notes:
calculations when the day of the week and the year are specified.
calculations when the day of the week and the year are specified.
(5)
(5)
For technical reasons, :meth:`strftime` method does not support
dates with year < 1000: ``t.strftime(format)`` will raise a
:exc:`ValueError` even if ``format`` does not contain ``%Y``
directive. The :meth:`strptime` method can parse years in the full
[1, 9999] range, but years < 1000 must be zero-filled to 4-digit
width.
.. versionchanged:: 3.2
In previous versions, :meth:`strftime` method was restricted to
years >= 1900.
(6)
For example, if :meth:`utcoffset` returns ``timedelta(hours=-3, minutes=-30)``,
For example, if :meth:`utcoffset` returns ``timedelta(hours=-3, minutes=-30)``,
``%z`` is replaced with the string ``'-0330'``.
``%z`` is replaced with the string ``'-0330'``.
...
...
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