[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 12

[issue19475] Add microsecond flag to datetime isoformat()

2015-07-24 Thread Berker Peksag
Changes by Berker Peksag : -- stage: resolved -> needs patch superseder: datetime: add ability to parse RFC 3339 dates and times -> versions: +Python 3.6 -Python 3.5 ___ Python tracker

[issue19475] Add microsecond flag to datetime isoformat()

2015-07-13 Thread Jerry Elmore
Changes by Jerry Elmore : -- nosy: +Jerry Elmore ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[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-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-04-22 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[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 re

[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 reas

[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 disp

[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-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 : >> +1 on adding an option to isoformat(). We already have an optional >> argument, so the symmetry with __str__ is not complete. To make this option >> more useful, rather t

[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 d

[issue19475] Add microsecond flag to datetime isoformat()

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

[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 ___ __

[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 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 argument 'p

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-05 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-05 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue19475] Add microsecond flag to datetime isoformat()

2013-11-03 Thread Andrei Dorian Duma
Changes by Andrei Dorian Duma : -- nosy: +andrei.duma ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[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