Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d32bf1

Browse files
harmandspganssle
authored andcommitted
bpo-13927: time.ctime and time.asctime return string explantion (GH-11303)
* bpo-13927: time.ctime and time.asctime return string explantion * Add note explaining that time.ctime and time.asctime returns a space padded date value in case it contains a single digit date * Reformat linebreaks
1 parent 692a0dc commit 2d32bf1

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

Doc/library/time.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,12 @@ Functions
127127

128128
Convert a tuple or :class:`struct_time` representing a time as returned by
129129
:func:`gmtime` or :func:`localtime` to a string of the following
130-
form: ``'Sun Jun 20 23:21:05 1993'``. If *t* is not provided, the current time
131-
as returned by :func:`localtime` is used. Locale information is not used by
132-
:func:`asctime`.
130+
form: ``'Sun Jun 20 23:21:05 1993'``. The day field is two characters long
131+
and is space padded if the day is a single digit,
132+
e.g.: ``'Wed Jun 9 04:26:40 1993'``.
133+
134+
If *t* is not provided, the current time as returned by :func:`localtime`
135+
is used. Locale information is not used by :func:`asctime`.
133136

134137
.. note::
135138

@@ -203,10 +206,15 @@ Functions
203206

204207
.. function:: ctime([secs])
205208

206-
Convert a time expressed in seconds since the epoch to a string representing
207-
local time. If *secs* is not provided or :const:`None`, the current time as
208-
returned by :func:`.time` is used. ``ctime(secs)`` is equivalent to
209-
``asctime(localtime(secs))``. Locale information is not used by :func:`ctime`.
209+
Convert a time expressed in seconds since the epoch to a string of a form:
210+
``'Sun Jun 20 23:21:05 1993'`` representing local time. The day field
211+
is two characters long and is space padded if the day is a single digit,
212+
e.g.: ``'Wed Jun 9 04:26:40 1993'``.
213+
214+
If *secs* is not provided or :const:`None`, the current time as
215+
returned by :func:`.time` is used. ``ctime(secs)`` is equivalent to
216+
``asctime(localtime(secs))``. Locale information is not used by
217+
:func:`ctime`.
210218

211219

212220
.. function:: get_clock_info(name)

0 commit comments

Comments
 (0)