aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/test/snmp_manager_config_test.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2012-01-11 14:42:03 +0100
committerMicael Karlberg <[email protected]>2012-01-12 12:13:18 +0100
commitae28d8822e0d0725c23483662d82e6986e5cefa5 (patch)
tree42433854815cacbafc3b7f885ff4f798a92bfd0e /lib/snmp/test/snmp_manager_config_test.erl
parent411f6240932aab3721ff842c674d9610216cfd88 (diff)
downloadotp-ae28d8822e0d0725c23483662d82e6986e5cefa5.tar.gz
otp-ae28d8822e0d0725c23483662d82e6986e5cefa5.tar.bz2
otp-ae28d8822e0d0725c23483662d82e6986e5cefa5.zip
[snmp/agent] Add common timestamp format function.
OTP-9851
Diffstat (limited to 'lib/snmp/test/snmp_manager_config_test.erl')
-rw-r--r--lib/snmp/test/snmp_manager_config_test.erl15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/snmp/test/snmp_manager_config_test.erl b/lib/snmp/test/snmp_manager_config_test.erl
index 4498d506f3..3192fe1b40 100644
--- a/lib/snmp/test/snmp_manager_config_test.erl
+++ b/lib/snmp/test/snmp_manager_config_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -2726,14 +2726,7 @@ p(F, A) ->
p(TName, F, A) ->
io:format("*** [~s] ***"
- " ~w -> " ++ F ++ "~n", [format_timestamp(now()),TName|A]).
-
-format_timestamp({_N1, _N2, N3} = Now) ->
- {Date, Time} = calendar:now_to_datetime(Now),
- {YYYY,MM,DD} = Date,
- {Hour,Min,Sec} = Time,
- FormatDate =
- io_lib:format("~.4w:~.2.0w:~.2.0w ~.2.0w:~.2.0w:~.2.0w 4~w",
- [YYYY,MM,DD,Hour,Min,Sec,round(N3/1000)]),
- lists:flatten(FormatDate).
+ " ~w -> " ++ F ++ "~n", [formated_timestamp(),TName|A]).
+formated_timestamp() ->
+ snmp_test_lib:formated_timestamp().