diff options
author | Harmandeep Singh <harmandeep.singh1@delhivery.com> | 2019-09-12 10:22:30 (GMT) |
---|---|---|
committer | Paul Ganssle <paul@ganssle.io> | 2019-09-12 10:22:30 (GMT) |
commit | 2d32bf1ef23c9e468b2e8afab3c24e7a2047ac36 (patch) | |
tree | 4c145928c872c3c05138296d5f5328f38f435b4f /Doc | |
parent | 692a0dc91597b7fb350383b633dc4d044cbd360e (diff) | |
download | cpython-2d32bf1ef23c9e468b2e8afab3c24e7a2047ac36.zip cpython-2d32bf1ef23c9e468b2e8afab3c24e7a2047ac36.tar.gz cpython-2d32bf1ef23c9e468b2e8afab3c24e7a2047ac36.tar.bz2 |
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
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/time.rst | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Doc/library/time.rst b/Doc/library/time.rst index 4faa0bb..65ab679 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -127,9 +127,12 @@ Functions Convert a tuple or :class:`struct_time` representing a time as returned by :func:`gmtime` or :func:`localtime` to a string of the following - form: ``'Sun Jun 20 23:21:05 1993'``. If *t* is not provided, the current time - as returned by :func:`localtime` is used. Locale information is not used by - :func:`asctime`. + form: ``'Sun Jun 20 23:21:05 1993'``. The day field is two characters long + and is space padded if the day is a single digit, + e.g.: ``'Wed Jun 9 04:26:40 1993'``. + + If *t* is not provided, the current time as returned by :func:`localtime` + is used. Locale information is not used by :func:`asctime`. .. note:: @@ -203,10 +206,15 @@ Functions .. function:: ctime([secs]) - Convert a time expressed in seconds since the epoch to a string representing - local time. If *secs* is not provided or :const:`None`, the current time as - returned by :func:`.time` is used. ``ctime(secs)`` is equivalent to - ``asctime(localtime(secs))``. Locale information is not used by :func:`ctime`. + Convert a time expressed in seconds since the epoch to a string of a form: + ``'Sun Jun 20 23:21:05 1993'`` representing local time. The day field + is two characters long and is space padded if the day is a single digit, + e.g.: ``'Wed Jun 9 04:26:40 1993'``. + + If *secs* is not provided or :const:`None`, the current time as + returned by :func:`.time` is used. ``ctime(secs)`` is equivalent to + ``asctime(localtime(secs))``. Locale information is not used by + :func:`ctime`. .. function:: get_clock_info(name) |