From: David ‘Bombe’ Roden Date: Thu, 21 Oct 2010 12:20:16 +0000 (+0200) Subject: Return age of Sone in seconds. X-Git-Tag: 0.1-RC1~116 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4c10e20e66c17da19aa94b5d81de385d2d885eee;p=Sone.git Return age of Sone in seconds. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java index e5385fa..3f1bbca 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java @@ -55,7 +55,7 @@ public class GetSoneStatusPage extends JsonPage { String soneId = request.getHttpRequest().getParam("sone"); Sone sone = core.getSone(soneId); SoneStatus soneStatus = core.getSoneStatus(sone); - return new JsonObject().put("status", soneStatus.name()).put("modified", sone.getModificationCounter() > 0).put("lastUpdated", new SimpleDateFormat("MMM d, yyyy, HH:mm:ss").format(new Date(sone.getTime()))); + return new JsonObject().put("status", soneStatus.name()).put("modified", sone.getModificationCounter() > 0).put("lastUpdated", new SimpleDateFormat("MMM d, yyyy, HH:mm:ss").format(new Date(sone.getTime()))).put("age", (System.currentTimeMillis() - sone.getTime()) / 1000); } }