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
f36e6a1a
Kaydet (Commit)
f36e6a1a
authored
Tem 12, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1731659: improve time.strptime docs.
(backport from rev. 56302)
üst
c5db9239
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
libtime.tex
Doc/lib/libtime.tex
+17
-9
No files found.
Doc/lib/libtime.tex
Dosyayı görüntüle @
f36e6a1a
...
...
@@ -309,15 +309,23 @@ The field width is normally 2 except for \code{\%j} where it is 3.
\begin{funcdesc}
{
strptime
}{
string
\optional
{
, format
}}
Parse a string representing a time according to a format. The return
value is a
\class
{
struct
_
time
}
as returned by
\function
{
gmtime()
}
or
\function
{
localtime()
}
. The
\var
{
format
}
parameter uses the same
directives as those used by
\function
{
strftime()
}
; it defaults to
\code
{
"
\%
a
\%
b
\%
d
\%
H:
\%
M:
\%
S
\%
Y"
}
which matches the formatting
returned by
\function
{
ctime()
}
. If
\var
{
string
}
cannot be parsed
according to
\var
{
format
}
,
\exception
{
ValueError
}
is raised. If the
string to be parsed has excess data after parsing,
\exception
{
ValueError
}
is raised. The default values used to fill in
any missing data when more accurate values cannot be inferred are
\code
{
(1900, 1, 1, 0, 0, 0, 0, 1, -1)
}
.
\function
{
localtime()
}
.
The
\var
{
format
}
parameter uses the same directives as those used by
\function
{
strftime()
}
; it defaults to
\code
{
"
\%
a
\%
b
\%
d
\%
H:
\%
M:
\%
S
\%
Y"
}
which matches the formatting returned by
\function
{
ctime()
}
.
If
\var
{
string
}
cannot be parsed according to
\var
{
format
}
, or if it
has excess data after parsing,
\exception
{
ValueError
}
is raised. The
default values used to fill in any missing data when more accurate
values cannot be inferred are
\code
{
(1900, 1, 1, 0, 0, 0, 0, 1, -1)
}
.
For example:
\begin{verbatim}
>>> import time
>>> time.strptime("30 Nov 00", "
%d %b %y")
(2000, 11, 30, 0, 0, 0, 3, 335, -1)
\end{verbatim}
Support for the
\code
{
\%
Z
}
directive is based on the values contained in
\code
{
tzname
}
and whether
\code
{
daylight
}
is true. Because of this,
...
...
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