Any way to read in a time?

Ferenc Wagner wferi@afavant.elte.hu
Fri, 18 Oct 2002 23:31:59 +0200


David Roundy <droundy@jdj5.mit.edu> writes:

> I've been looking at the standard Time module, and it
> seems pretty easy to convert a date into a string (using
> either calendarTimeToString or formatCalendarTime), but
> there doesn't seem to be any way to reverse the process.
> [...]
> Does anyone have a suggestion how best to go about this?

You may want to have a look at how the UNIX C library does
it: info libc "Parsing Date and Time".  If Linux is enough
for you, one possibility is to interface getdate_r() via the
FFI.  Note however, that this function isn't pure.

                                               Feri.