Repository navigation
bpo-13927: time.ctime and time.asctime return string explantion - #11303
Conversation
vstinner
left a comment
There was a problem hiding this comment.
It seems like the closest format is: "%a %b %d %H:%M:%S %Y".
>>> import time
>>> t=time.time()
>>> time.strftime("%a %b %d %H:%M:%S %Y", time.localtime(t))
'Sat Jan 05 00:17:28 2019'
>>> time.ctime(t)
'Sat Jan 5 00:17:28 2019'
The main difference is how the day is padded: space vs zero.
Would it help to add the strftime() format as example in the doc?
cc @pganssle
|
@harmands: Ping. Would you mind to update your PR? |
pganssle
left a comment
There was a problem hiding this comment.
I just realized I have a bunch of pending comments here that I never submitted. Sorry about that!
9cdc732 to
54664ff
Compare
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
* Add note explaining that time.ctime and time.asctime returns a space padded date value in case it contains a single digit date * Add example in date.ctime
54664ff to
9611c27
Compare
pganssle
left a comment
There was a problem hiding this comment.
In the interest of reducing friction, I just went ahead and made @JulienPalard's changes to the whitespace so we can merge this.
Changes applied, discussed in person.
|
I'm having trouble backporting to |
…onGH-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 (cherry picked from commit 2d32bf1) Co-authored-by: Harmandeep Singh <harmandeep.singh1@delhivery.com>
|
GH-16022 is a backport of this pull request to the 3.8 branch. |
…1303) * 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 (cherry picked from commit 2d32bf1) Co-authored-by: Harmandeep Singh <harmandeep.singh1@delhivery.com>
…onGH-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
https://bugs.python.org/issue13927