From: David ‘Bombe’ Roden Date: Mon, 12 Sep 2011 12:50:01 +0000 (+0200) Subject: Use correct time to get formatted time. X-Git-Tag: 0.6.7^2~1 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=98535f3438295050b13f1c59f9be4135dff1d9d5;p=Sone.git Use correct time to get formatted time. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java index 31ec399..f03e6e4 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetTimesAjaxPage.java @@ -52,7 +52,6 @@ public class GetTimesAjaxPage extends JsonPage { */ @Override protected JsonObject createJsonObject(Request request) { - long now = System.currentTimeMillis(); String allIds = request.getHttpRequest().getParam("posts"); JsonObject postTimes = new JsonObject(); if (allIds.length() > 0) { @@ -79,9 +78,8 @@ public class GetTimesAjaxPage extends JsonPage { if (reply == null) { continue; } - long age = now - reply.getTime(); JsonObject replyTime = new JsonObject(); - Time time = getTime(age); + Time time = getTime(reply.getTime()); replyTime.put("timeText", time.getText()); replyTime.put("refreshTime", time.getRefresh() / Time.SECOND); replyTime.put("tooltip", dateFormat.format(new Date(reply.getTime())));