an erlang/elixir rfc3339 lib
Go to file
Andrew Mayorov ee3a1a6b1e
Merge pull request #1 from rbkmoney/fix/follow-spec-strictly
Make library follow declared spec strictly
2018-07-03 18:18:54 +03:00
lib restrict input/output to rfc3339 spec 2016-01-31 20:54:14 -08:00
src Narrow down the 'timestamp as a map' type 2017-12-18 13:31:43 +03:00
test Make library follow declared spec strictly 2017-12-18 13:24:32 +03:00
.gitignore Added function parse_to_local_datetime/1 2016-07-02 14:34:54 +02:00
.travis.yml bump min elixir vsn to 1.2 2016-02-01 15:35:54 -08:00
LICENSE-APACHE initial commit 2016-01-24 23:10:26 -08:00
LICENSE-MIT initial commit 2016-01-24 23:10:26 -08:00
mix.exs update version in mix.exs 2017-04-28 21:00:28 -06:00
README.md Added function parse_to_local_datetime/1 2016-07-02 14:34:54 +02:00
rebar.config initial commit 2016-01-24 23:10:26 -08:00
rebar.lock initial commit 2016-01-24 23:10:26 -08:00

rfc3339

parse and format rfc3339 strings in elixir and erlang

Installing as a rebar depedancy (erlang)

You install it as a rebar dependency by adding the following in the deps section of rebar.config

    {rfc3339,  {git, "git://github.com/talentdeficit/rfc3339.git", {branch, master}}}

building

rebar3 compile

running

rebar3 shell

erlang usage

parse_to_local_datetime
> rfc3339:parse_to_local_datetime(<<"1996-12-19T16:39:57-08:00">>).
{{1996,12,19},{10,39,57}}
parse
> rfc3339:parse(<<"1937-01-01T12:00:27.87+00:20">>).
{ok,{{1937,1,1},{12,0,27},870000,20}}
format
> rfc3339:format({date(), time()}).
{ok,<<"2016-07-02T14:04:39Z">>}

todo

-[ ] everything