On Nov 10, 10:37 am, Jeremy Sanders <jeremy [EMAIL PROTECTED]> wrote: > Hi - I need to add support to a program for dates and times. The built-in > Python library seems to be okay for many purposes, but what I would like > would be Unix epoch style times (seconds relative to some date), covering a > large period from the past to the future. What would be nice would be a > library which can take floating point seconds from an epoch. > > Does anyone know of a library which can convert from human style dates and > times to a floating point epoch and back again? I expect I could fudge the > fractional seconds with the built-in library, but I can't see how to get > dates in the past. > > Thanks, Jeremy. > > -- > Jeremy Sandershttp://www.jeremysanders.net/
Have you looked at mx.DateTime: http://www.egenix.com/products/python/mxBase/mxDateTime/ In matplotlib, I also use their Dates modules functions for conversions (see the near bottom of the page): http://matplotlib.sourceforge.net/matplotlib.dates.html In the scipy sandbox, you can also build a package called 'TimeSeries': http://www.scipy.org/SciPyPackages/TimeSeries I also have trouble with date/times with whats available. Off the top of my head... converting a numpy array of epochs to some datetime object and back. If I had the time I'd contribute additional functionality to Pierre's and Matt's TimeSeries module (the one in scipy). -dieter -- http://mail.python.org/mailman/listinfo/python-list