[erlang-questions] [ANN] tempo: strptime/strftime bindings
OvermindDL1
overminddl1@REDACTED
Thu Jun 7 19:04:56 CEST 2012
On Thu, Jun 7, 2012 at 6:22 AM, Dmitry Groshev <lambdadmitry@REDACTED> wrote:
> 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
>
> (tempo_dev@REDACTED)1> {ok, Bin} = tempo:format(iso8601, {now, now()}).
> {ok,<<"2012-06-01T19:06:420000">>}
> (tempo_dev@REDACTED)2> tempo:parse(iso8601, {datetime, Bin}).
> {ok,{{2012,6,1},{19,6,42}}}
>
> Any feedback is appreciated,
> Dmitry
Looks to be useful, may use it in my next project that needs such
formatting (which is quite common) to see how it compares.
More information about the erlang-questions
mailing list