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

Mike Gleen report at bugs.python.org
Sat Oct 6 04:56:27 EDT 2018


Mike Gleen <mike.gleen at gmail.com> 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 <
report at bugs.python.org> wrote:

>
> Karthikeyan Singaravelan <tir.karthi at gmail.com> 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 <report at bugs.python.org>
> <https://bugs.python.org/issue34903>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34903>
_______________________________________


More information about the docs mailing list