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

Antoine Pitrou solipsis at pitrou.net
Thu Dec 11 20:46:52 CET 2014


On Thu, 11 Dec 2014 13:43:05 -0600
Skip Montanaro <skip.montanaro at gmail.com> wrote:
> On Thu, Dec 11, 2014 at 1:23 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> > I think strftime / strptime support is a low-priority concern on this
> > topic, and can probably be discussed independently of the core
> > nanosecond support.
> 
> Might be low-priority, but with %f support as a template, supporting
> something to specify nanoseconds should be pretty trivial. The hardest
> question will be to convince ourselves that we aren't choosing a
> format code which some other strftime/strptime implementation is
> already using.
> 
> In addition, ISTR that one of the use cases was analysis of datetime
> data generated by other applications which has nanosecond resolution.

One of the use cases is to deal with OS-generated timestamps without
losing information. As long as you don't need to represent or parse
those timestamps, strptime / strftime don't come into the picture.

Regards

Antoine.


More information about the Python-Dev mailing list