Skip to content

Instantly share code, notes, and snippets.

@artefactop
Created May 21, 2013 18:04
Show Gist options
  • Save artefactop/5621905 to your computer and use it in GitHub Desktop.
Save artefactop/5621905 to your computer and use it in GitHub Desktop.
erlang dates to integer iso8601
date_to_integer_iso8601({date,{Y,M,D}}) ->
datetime_to_integer_iso8601({datetime,{{Y,M,D},{0,0,0}}}).
datetime_to_integer_iso8601({datetime,{{Y,M,D},{H,Min,S}}}) ->
Y * 10000000000 + M * 100000000 + D * 1000000 + H * 10000 + Min * 100 + S.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment