mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Added now_str to return the local time as a string.
This commit is contained in:
parent
89dc8095b0
commit
bed9ab10aa
1 changed files with 6 additions and 1 deletions
|
@ -28,7 +28,8 @@
|
||||||
is_arch/1,
|
is_arch/1,
|
||||||
get_os/0,
|
get_os/0,
|
||||||
sh/2,
|
sh/2,
|
||||||
sh_failfast/2]).
|
sh_failfast/2,
|
||||||
|
now_str/0]).
|
||||||
|
|
||||||
-include("rebar.hrl").
|
-include("rebar.hrl").
|
||||||
|
|
||||||
|
@ -75,6 +76,10 @@ sh_failfast(Command, Env) ->
|
||||||
?FAIL
|
?FAIL
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
now_str() ->
|
||||||
|
{{Year, Month, Day}, {Hour, Minute, Second}} = calendar:local_time(),
|
||||||
|
lists:flatten(io_lib:format("~4b/~2..0b/~2..0b ~2..0b:~2..0b:~2..0b",
|
||||||
|
[Year, Month, Day, Hour, Minute, Second])).
|
||||||
|
|
||||||
%% ====================================================================
|
%% ====================================================================
|
||||||
%% Internal functions
|
%% Internal functions
|
||||||
|
|
Loading…
Reference in a new issue