[erlang-questions] strptime?
Gustav Simonsson
gustav.simonsson@REDACTED
Tue Aug 31 21:52:58 CEST 2010
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" <djk121@REDACTED>
To: erlang-questions@REDACTED
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
More information about the erlang-questions
mailing list