[issue34903] strptime %d handling of single digit day of month

2019-06-17 Thread Mike Gleen


Change by Mike Gleen :


--
pull_requests: +13990
pull_request: https://github.com/python/cpython/pull/14149

___
Python tracker 
<https://bugs.python.org/issue34903>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34903] strptime %d handling of single digit day of month

2018-10-06 Thread Mike Gleen


Mike Gleen  added the comment:

Thanks for the quick response. I would be happy to write a pull request for
the doc change. I've never done this before so it'll take a little while to
get my head around the process, but the "Helping with Documentation"
chapter seems good.

Mike

On Sat, Oct 6, 2018 at 7:09 AM Karthikeyan Singaravelan <
rep...@bugs.python.org> wrote:

>
> Karthikeyan Singaravelan  added the comment:
>
> In addition to %d there are also other items that support single digit
> though zero padding is mentioned with strptime as below in the context of
> strftime :
>
> >>> import datetime
> >>> datetime.datetime.strptime("1/1/2018 1:1:1", "%d/%m/%Y %I:%M:%S")
> datetime.datetime(2018, 1, 1, 1, 1, 1)
>
>
> >>> datetime.datetime.strftime(datetime.datetime(year=2018, month=1,
> day=1, hour=1, second=1, minute=1), "%d/%m/%Y %I:%M:%S")
> '01/01/2018 01:01:01'
>
> I couldn't find exact set of words that can be used to denote that zero
> padding is optional in strptime and it's returned as zero padded in
> strftime but if we are changing %d then I propose changing other items too
> with similar wording.
>
> Thanks
>
> --
> nosy: +xtreak
>
> ___
> Python tracker 
> <https://bugs.python.org/issue34903>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue34903>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34903] strptime %d handling of single digit day of month

2018-10-05 Thread Mike Gleen


Mike Gleen  added the comment:

Sorry for the omission. This refers to datetime.datetime.strptime. The 
documentation I referenced is: https://docs.python.org/3/library/datetime.html; 
I did not test 2.7.

--

___
Python tracker 
<https://bugs.python.org/issue34903>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34903] strptime %d handling of single digit day of month

2018-10-05 Thread Mike Gleen


New submission from Mike Gleen :

strptime correctly parses single digit day-of-month values (at least in the 
case of "%d %b %Y") which is the behavior I want. However, the documentation 
seems to say that the field must be two digits with a leading zero if 
necessary. So I hope that this is the intended behavior rather than just an 
accidental artifact. If so, then my suggestion is that the documentation be 
updated to reflect this.

--
assignee: docs@python
components: Documentation
messages: 327109
nosy: Mike Gleen, docs@python
priority: normal
severity: normal
status: open
title: strptime %d handling of single digit day of month
type: behavior
versions: Python 3.6

___
Python tracker 
<https://bugs.python.org/issue34903>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com