[erlang-questions] strptime?

Gordon Guthrie <>
Tue Aug 31 22:20:05 CEST 2010


Dale Harvey has published a date/time parser on github as well:

http://github.com/daleharvey/erlang_util/blob/master/dh_date.erl

<http://github.com/daleharvey/erlang_util/blob/master/dh_date.erl>Gordon

On 31 August 2010 20:52, Gustav Simonsson <
> wrote:

>
> http://www.erlang.org/doc/man/calendar.html
> has a bunch of date and time functions.
>
> http://www.erlang.org/doc/man/string.html#tokens-2
> is useful for parsing strings in general, but as
> your datetime string doesn't have separator characters
> you have to parse it "manually".
>
> Best Regards, Gustav Simonsson.
>
> ----- Original Message -----
> From: "Dan Kelley" <>
> To: 
> Sent: Tuesday, 31 August, 2010 17:14:38 GMT +01:00 Amsterdam / Berlin /
> Bern / Rome / Stockholm / Vienna
> Subject: [erlang-questions] strptime?
>
> HI,
>
> I'm an erlang noob.  I'm trying write a program in erlang that will replace
> a program that's currently implemented in python.  The program needs to
> parse XML documents, perform some calculations on the contents, and
> populate
> a write-through cache that's backed by a database.
>
> Some of the elements that I'm parsing out of the XML documents are date
> strings, which look like "20091215015928".  In the python program, I'm
> parsing these into datetime.datetime objects, which I then use as
> dictionary
> keys in the cache.
>
> While working on the erlang version of the program, I tried to find the
> erlang stdlib date parsing routines.  To my surprise, I couldn't find any
> helper functions for parsing datetime representations out of strings.  This
> seems unlikely enough that there's a chance I'm missing something obvious.
>  Am I?
>
> Thanks,
>
> Dan
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>


-- 
Gordon Guthrie
CEO hypernumbers

http://hypernumbers.com
t: hypernumbers
+44 7776 251669


More information about the erlang-questions mailing list