diff options
author | Erland Schönbeck <[email protected]> | 2015-03-09 14:45:25 +0100 |
---|---|---|
committer | Erland Schönbeck <[email protected]> | 2015-03-09 14:45:25 +0100 |
commit | 6c59d3f422ca9ee1687abda43cf553eea09d78bf (patch) | |
tree | 0ce1a873f93860662ddbf1fd6561a7c6f490077d /lib/ssh/src/ssh_info.erl | |
parent | 7d1039b311fcbd5f833856d7eac7a360c253a436 (diff) | |
parent | 601ba7763892ddf81e4331962210771bdad04c82 (diff) | |
download | otp-6c59d3f422ca9ee1687abda43cf553eea09d78bf.tar.gz otp-6c59d3f422ca9ee1687abda43cf553eea09d78bf.tar.bz2 otp-6c59d3f422ca9ee1687abda43cf553eea09d78bf.zip |
Merge branch 'maint'
Conflicts:
erts/test/otp_SUITE.erl
Diffstat (limited to 'lib/ssh/src/ssh_info.erl')
-rw-r--r-- | lib/ssh/src/ssh_info.erl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_info.erl b/lib/ssh/src/ssh_info.erl index 9ed598b3ab..e5a8666af0 100644 --- a/lib/ssh/src/ssh_info.erl +++ b/lib/ssh/src/ssh_info.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2014. All Rights Reserved. +%% Copyright Ericsson AB 2008-2015. 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 @@ -179,7 +179,14 @@ line(Len, Char) -> datetime() -> - {{YYYY,MM,DD}, {H,M,S}} = calendar:now_to_universal_time(now()), + %% Adapt to new OTP 18 erlang time API and be back-compatible + TimeStamp = try + erlang:timestamp() + catch + error:undef -> + erlang:now() + end, + {{YYYY,MM,DD}, {H,M,S}} = calendar:now_to_universal_time(TimeStamp), lists:flatten(io_lib:format('~4w-~2..0w-~2..0w ~2..0w:~2..0w:~2..0w UTC',[YYYY,MM,DD, H,M,S])). |