Hey John,

NumPy doesn't provide this, because it's already provided by the
datetime.date.strftime function in Python:

http://docs.python.org/library/datetime.html#datetime.date.strftime

One reason this format isn't supported automatically is that parsing
"MM/dd/YY" is inherently ambiguous, and the convention is different in
different parts of the world. The date "01/02/03" could be January 2nd 2003
or February 3rd, 2001, for example. The datetime constructor follows the
ISO 8601 standard for date and time formatting, which is unambiguous. This
was specified in the datetime NEP, but the 1.6 implementation unfortunately
hadn't followed that part of the spec.

Cheers,
Mark

On Mon, Feb 6, 2012 at 12:40 PM, John Salvatier
<jsalv...@u.washington.edu>wrote:

> Hello,
>
> Is there a way to specify a format for the datetime64 constructor? The
> constructor doesn't have a doc. I have dates in a file with the format
> "MM/dd/YY". datetime64 used to be able to parse these in 1.6.1 but the dev
> version throws an error.
>
> Cheers,
> John
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to