[issue19475] Add microsecond flag to datetime isoformat()

2015-07-24 Thread STINNER Victor
STINNER Victor added the comment: 'seconds' - %H:%M:%S 'us' - %H:%M:%S.%f 'us' is not consistent with the datetime module: it should be 'microseconds. datetime.datetime.now().second 50 datetime.timedelta(seconds=1) datetime.timedelta(0, 1) datetime.datetime.now().microsecond 123710

[issue19475] Add microsecond flag to datetime isoformat()

2015-07-24 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: resolved - needs patch superseder: datetime: add ability to parse RFC 3339 dates and times - versions: +Python 3.6 -Python 3.5 ___ Python tracker rep...@bugs.python.org

[issue19475] Add microsecond flag to datetime isoformat()

2015-07-13 Thread Jerry Elmore
Changes by Jerry Elmore jerry.r.elm...@gmail.com: -- nosy: +Jerry Elmore ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19475 ___ ___

[issue19475] Add microsecond flag to datetime isoformat()

2014-06-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Here is some prior art: GNU date utility has an --iso-8601[=timespec] option defined as ‘-I[timespec]’ ‘--iso-8601[=timespec]’ Display the date using the ISO 8601 format, ‘%Y-%m-%d’. The argument timespec specifies the number of additional terms of the

[issue19475] Add microsecond flag to datetime isoformat()

2014-06-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Based on GNU date prior art, we can introduce timespec='auto' keyword argument with the following values: 'auto' - (default) same as current behavior 'hours' - %H 'minutes' - %H:%M 'seconds' - %H:%M:%S 'us' - %H:%M:%S.%f --

[issue19475] Add microsecond flag to datetime isoformat()

2014-04-23 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19475 ___ ___ Python-bugs-list

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: MAL: Have you thought about the rounding/truncation issues associated with not showing microseconds ? I believe it has to be the truncation. Rounding is better left to the user code where it can be done either using timedelta arithmetics or at the time

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-06 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 06.11.2013 16:51, Alexander Belopolsky wrote: MAL: Have you thought about the rounding/truncation issues associated with not showing microseconds ? Sure, otherwise I wouldn't have mentioned it :-) mxDateTime always uses 2 digit fractions when

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am afraid that the rounding issues may kill this proposal. Can we start with something simple? For example, we can start with show=None keyword argument and allow a single value 'microseconds' (or 'us'). This will solve the issue at hand with a

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-06 Thread Skip Montanaro
Skip Montanaro added the comment: I am afraid that the rounding issues may kill this proposal. Can we start with something simple? For example, we can start with show=None keyword argument and allow a single value 'microseconds' (or 'us'). This will solve the issue at hand with a

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-05 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19475 ___ ___ Python-bugs-list

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-05 Thread Alexander Belopolsky
Changes by Alexander Belopolsky alexander.belopol...@gmail.com: -- nosy: +belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19475 ___ ___

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: +1 on adding an option to isoformat(). We already have an optional sep argument, so the symmetry with __str__ is not complete. To make this option more useful, rather than implementing always_emit_microseconds=False flag, I would add a keyword

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-05 Thread Andrei Dorian Duma
Andrei Dorian Duma added the comment: I would like to implement this feature. I already wrote the Python part. Is there anything else to decide? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19475

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-05 Thread STINNER Victor
STINNER Victor added the comment: 2013/11/5 Alexander Belopolsky rep...@bugs.python.org: +1 on adding an option to isoformat(). We already have an optional sep argument, so the symmetry with __str__ is not complete. To make this option more useful, rather than implementing

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: +1 on all Victor's points. I like 'resolution' because this is the term that datetime module uses already: from datetime import * datetime.resolution datetime.timedelta(0, 0, 1) There is a slight chance of confusion stemming from the fact that

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 05.11.2013 21:31, STINNER Victor wrote: 2013/11/5 Alexander Belopolsky rep...@bugs.python.org: +1 on adding an option to isoformat(). We already have an optional sep argument, so the symmetry with __str__ is not complete. To make this option

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-03 Thread Andrei Dorian Duma
Changes by Andrei Dorian Duma andrei.duma.dor...@gmail.com: -- nosy: +andrei.duma ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19475 ___ ___

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: As I understand Guido's message, he reopened this to consider adding a new parameter. Given an existing csv file like that given, either Tim's solution or try: parse with microseconds except ValueError: parse without should work. -- nosy: +terry.reedy