Re: [Numpy-discussion] just the date part of a datetime64[s]?

2012-02-09 Thread John Salvatier
Thanks Mark! John On Wed, Feb 8, 2012 at 6:48 PM, Mark Wiebe mwwi...@gmail.com wrote: Converting between date and datetime requires caution, because it depends on your time zone. Because all datetime64's are internally stored in UTC, simply casting as in your example treats it in UTC. The

[Numpy-discussion] just the date part of a datetime64[s]?

2012-02-08 Thread John Salvatier
Hello, is there a good way to get just the date part of a datetime64? Frequently datetime datatypes have month(), date(), hour(), etc functions that pull out part of the datetime, but I didn't see those mentioned in the datetime64 docs. Casting to a 'D' dtype didn't work as I would have hoped: In

Re: [Numpy-discussion] just the date part of a datetime64[s]?

2012-02-08 Thread Mark Wiebe
Converting between date and datetime requires caution, because it depends on your time zone. Because all datetime64's are internally stored in UTC, simply casting as in your example treats it in UTC. The 'astype' function does not raise an error to tell you that this is problematic, because