aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-04-15 14:27:47 +0200
committerMicael Karlberg <[email protected]>2019-04-15 14:27:47 +0200
commitfaa6a36586dd1fe8a3a6bb2507c9b02781b4d386 (patch)
tree356d68889d120d100f9e2d327e18757683293fb3
parentfa20cc53c440a5da854f109fefc3a65270031844 (diff)
downloadotp-faa6a36586dd1fe8a3a6bb2507c9b02781b4d386.tar.gz
otp-faa6a36586dd1fe8a3a6bb2507c9b02781b4d386.tar.bz2
otp-faa6a36586dd1fe8a3a6bb2507c9b02781b4d386.zip
[snmp|agent] Fix types
There no timestamp type in os (but there is in erlang).
-rw-r--r--lib/snmp/src/misc/snmp_misc.erl22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/snmp/src/misc/snmp_misc.erl b/lib/snmp/src/misc/snmp_misc.erl
index 0cc04d4056..39254503ac 100644
--- a/lib/snmp/src/misc/snmp_misc.erl
+++ b/lib/snmp/src/misc/snmp_misc.erl
@@ -151,41 +151,41 @@ formated_long_timestamp() ->
%% the date in the formatted timestamp.
%% ---------------------------------------------------------------------------
--spec format_timestamp(Now :: os:timestamp()) ->
+-spec format_timestamp(Now :: erlang:timestamp()) ->
string().
format_timestamp(Now) ->
format_long_timestamp(Now).
--spec format_short_timestamp(Now :: os:timestamp()) ->
+-spec format_short_timestamp(Now :: erlang:timestamp()) ->
string().
format_short_timestamp(Now) ->
N2T = fun(N) -> calendar:now_to_local_time(N) end,
format_timestamp(short, Now, N2T).
--spec format_long_timestamp(Now :: os:timestamp()) ->
+-spec format_long_timestamp(Now :: erlang:timestamp()) ->
string().
format_long_timestamp(Now) ->
N2T = fun(N) -> calendar:now_to_local_time(N) end,
format_timestamp(long, Now, N2T).
--spec format_timestamp(Now :: os:timestamp(),
+-spec format_timestamp(Now :: erlang:timestamp(),
N2T :: function()) ->
string().
format_timestamp(Now, N2T) when is_tuple(Now) andalso is_function(N2T) ->
format_long_timestamp(Now, N2T).
--spec format_short_timestamp(Now :: os:timestamp(),
+-spec format_short_timestamp(Now :: erlang:timestamp(),
N2T :: function()) ->
string().
format_short_timestamp(Now, N2T) when is_tuple(Now) andalso is_function(N2T) ->
format_timestamp(short, Now, N2T).
--spec format_long_timestamp(Now :: os:timestamp(),
+-spec format_long_timestamp(Now :: erlang:timestamp(),
N2T :: function()) ->
string().
@@ -195,14 +195,8 @@ format_long_timestamp(Now, N2T) when is_tuple(Now) andalso is_function(N2T) ->
format_timestamp(Format, {_N1, _N2, N3} = Now, N2T) ->
{Date, Time} = N2T(Now),
do_format_timestamp(Format, Date, Time, N3).
- %% case Format of
- %% short ->
- %% do_format_short_timestamp(Time, N3);
- %% long ->
- %% do_format_long_timestamp(Date, Time, N3)
- %% end.
-
-do_format_timestamp(short, Date, Time, N3) ->
+
+do_format_timestamp(short, _Date, Time, N3) ->
do_format_short_timestamp(Time, N3);
do_format_timestamp(long, Date, Time, N3) ->
do_format_long_timestamp(Date, Time, N3).