ShowConnections: Fix display for connection time older than one day

Session start time should be displayed as MMM-dd if it's more than one
day ago but it's not. Check for session age is done incorrectly.

Change-Id: I86c000b42661ee01f5893d571ea77490fc1fce13
This commit is contained in:
Olof Ekedahl 2018-02-19 12:30:20 +01:00 committed by David Pursehouse
parent 7823dab9e7
commit f12e75f769

View File

@ -174,7 +174,7 @@ final class ShowConnections extends SshCommand {
}
private static String time(final long now, final long time) {
if (time - now < 24 * 60 * 60 * 1000L) {
if (now - time < 24 * 60 * 60 * 1000L) {
return new SimpleDateFormat("HH:mm:ss").format(new Date(time));
}
return new SimpleDateFormat("MMM-dd").format(new Date(time));