Skip to content

Instantly share code, notes, and snippets.

@mwicat
Created July 24, 2012 12:09
Show Gist options
  • Select an option

  • Save mwicat/3169581 to your computer and use it in GitHub Desktop.

Select an option

Save mwicat/3169581 to your computer and use it in GitHub Desktop.
erlang timestamp
ts() ->
{{Y,M,D},{H,Min,S}} = calendar:now_to_local_time(now()),
io_lib:format("-~4.4.0w~2.2.0w~2.2.0w-~2.2.0w~2.2.0w~2.2.0w",
[Y,M,D,H,Min,S]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment