Skip to content

bpo-13927: time.ctime and time.asctime return string explantion - #11303

Merged
pganssle merged 6 commits into
python:masterfrom
harmands:ctime_asctime_doc
Sep 12, 2019
Merged

pganssle merged 6 commits into
python:masterfrom
harmands:ctime_asctime_doc

Conversation

@harmands

@harmands harmands commented Dec 24, 2018 •

Copy link
Copy Markdown
Contributor
  • 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

https://bugs.python.org/issue13927

@lisroach lisroach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread Doc/library/time.rst Resolved
Comment thread Doc/library/time.rst Resolved
@vstinner

Copy link
Copy Markdown
Member

@harmands: Ping. Would you mind to update your PR?

@pganssle pganssle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized I have a bunch of pending comments here that I never submitted. Sorry about that!

Comment thread Doc/library/time.rst Resolved
Comment thread Doc/library/time.rst Resolved
@harmands
harmands force-pushed the ctime_asctime_doc branch 2 times, most recently from 9cdc732 to 54664ff Compare April 12, 2019 13:23
Comment thread Doc/library/time.rst Resolved
@bedevere-bot

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@pganssle pganssle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interest of reducing friction, I just went ahead and made @JulienPalard's changes to the whitespace so we can merge this.

@pganssle
pganssle dismissed JulienPalard’s stale review September 12, 2019 10:16

Changes applied, discussed in person.

@pganssle
pganssle removed the request for review from abalkin September 12, 2019 10:16
@pganssle
pganssle merged commit 2d32bf1 into python:master Sep 12, 2019
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @harmands for the PR, and @pganssle for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

I'm having trouble backporting to 3.8. Reason: 'Error 110 while writing to socket. Connection timed out.'. Please retry by removing and re-adding the needs backport to 3.8 label.

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @harmands for the PR, and @pganssle for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 12, 2019
…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>
@bedevere-bot

Copy link
Copy Markdown

GH-16022 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Sep 12, 2019
…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>
DinoV pushed a commit to DinoV/cpython that referenced this pull request Sep 12, 2019
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants