From bed9ab10aaeb281d0aaa010a6e29f081bc39eecf Mon Sep 17 00:00:00 2001 From: "jmeredith@jons-macbook.local" Date: Thu, 3 Dec 2009 22:46:37 -0700 Subject: [PATCH] Added now_str to return the local time as a string. --- src/rebar_utils.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl index cda6f60..b263644 100644 --- a/src/rebar_utils.erl +++ b/src/rebar_utils.erl @@ -28,7 +28,8 @@ is_arch/1, get_os/0, sh/2, - sh_failfast/2]). + sh_failfast/2, + now_str/0]). -include("rebar.hrl"). @@ -75,6 +76,10 @@ sh_failfast(Command, Env) -> ?FAIL 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