From: Chris B. <Chr...@no...> - 2004-09-16 17:03:23
|
>>I think the >>cleanest approach is to require python2.3 and datetime. Ie, I would >>jettison support for epoch times and mx datetimes, as well as the >>converter stuff. +1 on this. >> def plot_date(self, d, y, fmt='bo', **kwargs): >> >>where d would be an array of floats (no converter) and the floats >>would be the number of days since 1,1,1 (Gregorian calendar). The >>supported date range would be datetime.min to datetime.max (years 0001 >>- 9999). > > Actually, MATLAB adopts the same approach using floats for date and time. I think you should generally not blindly apply the MATLAB approach. Python is a more powerful language than MATLAB, and support for more than just doubles is one it's features! How does the datetime module store the values in a datetime object? My first inclination would be to follow it's approach, but it may not be suited to arrays ( :-( ) A couple projects you might want to make use of: http://pytz.sourceforge.net/ and: https://moin.conectiva.com.br/DateUtil -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |