[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: New changeset 32318930da70ff03320ec50813b843e7db6fbc2e by Alexander Belopolsky (Mario Corchero) in branch 'master': Closes bpo-31800: Support for colon when parsing time offsets (#4015) https://github.com/python/cpython/commit/32318930da70ff03320ec50813b

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Note that #5288 relaxed the whole number of minutes restriction on UTC offsets. Since the goal is to be able to parse the output of .isoformat(), I think %z should accept sub-minute offsets. -- nosy: +belopolsky ___

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-19 Thread Mario Corchero
Mario Corchero added the comment: I have a patch to add 'Z' support as well if we are interested in making it the same as it glibc does. (as it supports it as well) -- ___ Python tracker

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-19 Thread Mario Corchero
Mario Corchero added the comment: As a note Seems support for the ":" was added in 2015 for glibc: http://code.metager.de/source/xref/gnu/glibc/time/strptime_l.c#765 Commit e952e1df Before that, it basically just ignores the minutes. -- ___ Python

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-19 Thread Paul G
Paul G added the comment: This seems very useful to me. I very frequently advise people *against* using dateutil.parser (despite my conflict of interest as maintainer of dateutil) for well-known formats, but the problem frequently comes up of, "what should I do when I have date created by iso

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-17 Thread Mario Corchero
Mario Corchero added the comment: Yep, http://man7.org/linux/man-pages/man3/strptime.3.html does support it even if it might look asymetrical. Example: struct tm tm; char buf[255]; memset(&tm, 0, sizeof(struct tm)); strptime("+00:00", "%z", &tm);

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Martin Panter
Martin Panter added the comment: FWIW it looks like “strptime” in glibc, and Open and Free BSD support parsing this and even more formats (RFC 822 and RFC 3339; includes “Z”, U.S. time zones, ±HH). Also, there is Issue 24954 for adding “%:z” like Gnu “date”. -- nosy: +martin.panter _

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Martin Panter
Martin Panter added the comment: Sorry, I meant Net BSD not Free BSD -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Mario Corchero
Change by Mario Corchero : -- keywords: +patch pull_requests: +3989 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Mario Corchero
New submission from Mario Corchero : Currently, datetime.strptime does not support parsing utc offsets that include a colon. "+" is parsed without issues whilst it fails with "+00:00". "+NN:NN" is not only ISO8601 valid but also the way the offset is presented to the user when using .isofo