[erlang-questions] [ANN] tempo: strptime/strftime bindings

Dmitry Groshev <>
Thu Jun 7 14:22:44 CEST 2012


Hello fellow erlangers,

As we all know, there is a substantial amount of pain in the field of
time parsing/formatting in Erlang -- strings instead binaries,
different time formats and so on. So we've written a binding to libc's
strptime/strftime that takes and returns binaries and almost all
common formats of time.

https://github.com/selectel/tempo

()1> {ok, Bin} = tempo:format(iso8601, {now, now()}).
{ok,<<"2012-06-01T19:06:420000">>}
()2> tempo:parse(iso8601, {datetime, Bin}).
{ok,{{2012,6,1},{19,6,42}}}

Any feedback is appreciated,
Dmitry



More information about the erlang-questions mailing list