Skip to content

Instantly share code, notes, and snippets.

@hpyhacking
Created February 1, 2012 15:33
Show Gist options
  • Save hpyhacking/1717551 to your computer and use it in GitHub Desktop.
Save hpyhacking/1717551 to your computer and use it in GitHub Desktop.
erlang timestamp to integer
get_timestamp() ->
T1 = calendar:datetime_to_gregorian_seconds(erlang:localtime()),
T2 = calendar:datetime_to_gregorian_seconds({{1970, 1, 1}, {0, 0, 0}}),
T1 - T2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment