Created
January 19, 2018 01:58
-
-
Save HJianBo/6a7bb6091cbaaa520b957fe831c5ea05 to your computer and use it in GitHub Desktop.
Erlang Utils Functions
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
binmstime() -> | |
%% The time is EMQ server time | |
{Year, Mon, Day} = date(), | |
{Hour, Min, Sec} = time(), | |
{_, _, MicroSecs} = erlang:timestamp(), | |
list_to_binary( | |
lists:flatten( | |
io_lib:format("~2..0w~2..0w~2..0w~2..0w~2..0w~2..0w~3..0w", [Year,Mon,Day,Hour,Min,Sec,trunc(MicroSecs/1000)]))). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment