From 9606115c1eff29fbefead084ee9789fe4770b099 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 25 Feb 2005 03:35:04 +0000 Subject: [PATCH] format time like the real who command --- bindings/java/src/net/hyperic/sigar/cmd/Who.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bindings/java/src/net/hyperic/sigar/cmd/Who.java b/bindings/java/src/net/hyperic/sigar/cmd/Who.java index f7244e9b..5ee55136 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/Who.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/Who.java @@ -1,6 +1,7 @@ package net.hyperic.sigar.cmd; import java.util.Date; +import java.text.SimpleDateFormat; import net.hyperic.sigar.Sigar; import net.hyperic.sigar.SigarException; @@ -19,12 +20,17 @@ public class Who extends SigarCommandBase { return "Show who is logged on"; } + private String getTime(long time) { + String fmt = "MMM dd HH:mm"; + return new SimpleDateFormat(fmt).format(new Date(time)); + } + public void output(String[] args) throws SigarException { net.hyperic.sigar.Who[] who = this.sigar.getWhoList(); for (int i=0; i