[Python-Dev] datetime nanosecond support (ctd?)

Guido van Rossum guido at python.org
Tue Dec 16 20:21:18 CET 2014


I vote to copy Ruby's %N and leave %f alone.

On Tue, Dec 16, 2014 at 11:08 AM, Skip Montanaro <skip.montanaro at gmail.com>
wrote:
>
>
> On Tue, Dec 16, 2014 at 11:10 AM, matthieu bec <mbec at gmto.org> wrote:
> > Agreed with Antoine, strftime/strptime are somewhat different concerns.
> > Doesn't mean thay cannot be fixed at the same time but it's a bit a
> > separate.
>
> Which reminds me... Somewhere else (maybe elsewhere in this thread? maybe
> on a bug tracker issue?) someone mentioned that Ruby uses %N for fractions
> of a second (and %L specifically for milliseconds). Here's the bit from the
> Ruby strftime doc:
>
> %L - Millisecond of the second (000..999)
> %N - Fractional seconds digits, default is 9 digits (nanosecond)
>           %3N  millisecond (3 digits)
>           %6N  microsecond (6 digits)
>           %9N  nanosecond (9 digits)
>           %12N picosecond (12 digits)
>
> There's no obvious reason I can see to reinvent this particular wheel, at
> least the %N spoke. The only question might be whether to modify Python's
> existing %f format to accept a precision (defaulting to 6), or add %N in a
> manner similar (or identical) to Ruby's semantics.
>
> Skip
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/guido%40python.org
>
>

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20141216/39934b61/attachment.html>


More information about the Python-Dev mailing list