This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author goshawk
Recipients Arfrever, belopolsky, goshawk, lemburg, r.david.murray, vstinner
Date 2012-07-25.00:42:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <500F40E9.2030208@gmail.com>
In-reply-to <1343172019.87.0.520346621185.issue15443@psf.upfronthosting.co.za>
Content
On 07/24/2012 04:20 PM, R. David Murray wrote:
> R. David Murray <rdmurray@bitdance.com> added the comment:
> 
> Are the nanosecond timestamps timestamps or strings?  If they are timestamps it's not immediately obvious why you want to convert them to datetime objects, so motivating that would probably help.  On the other hand the fact that you have an application that does so is certain an argument for real world applicability.

It depends. When they are exported for example as csv (this can be the
case of market stock) or json (which is close to my case) that's a
string so having a datetime object may be very helpful in doing datetime
adds, subs, <, deltas and in changing representation to human readable
format thanks to strftime() without loosing precison and maintaining
readability.

Think about a web application. User selects year, month, day, hour,
minute, millisecond, nanosecond of an event and the javascript does a
ajax call with time of this format (variant of iso8601):
YYYY-MM-DDTHH:MM:SS.mmmmmmnnn (where nnn is the nanosecond representation).
The python server takes that string, converts to a datetime, does all
the math with its data and gives the output back using labeling data
with int(nano_datetime.strftime('MMSSmmmmmmnnn')) so I've a sequence
number that javascript can sort and handle easily.

It's basically the same you already do nowadays at microseconds level,
but this time you have to deal with nanosecond data.

I agree with the YAGNI principle and I think that we have a clear
evidence of a real use case here indeed.

Best Regards
History
Date User Action Args
2012-07-25 00:42:23goshawksetrecipients: + goshawk, lemburg, belopolsky, vstinner, Arfrever, r.david.murray
2012-07-25 00:42:23goshawklinkissue15443 messages
2012-07-25 00:42:22goshawkcreate