Created
February 1, 2012 15:33
-
-
Save hpyhacking/1717551 to your computer and use it in GitHub Desktop.
erlang timestamp to integer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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