From 4bd86b514131c6df0bf46443f024f2277d43f08c Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Sun, 12 Oct 2014 01:31:57 +0200 Subject: Round lastModifiedTime to last second when returning it for HTTP, but not internally. --- org/madore/damlengine/WeblogServlet.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'org/madore') diff --git a/org/madore/damlengine/WeblogServlet.java b/org/madore/damlengine/WeblogServlet.java index 8629d7e..d9b0958 100644 --- a/org/madore/damlengine/WeblogServlet.java +++ b/org/madore/damlengine/WeblogServlet.java @@ -34,7 +34,7 @@ import javax.servlet.http.HttpServletResponse; public class WeblogServlet extends HttpServlet { - private static final long serialVersionUID = 2014101005L; + private static final long serialVersionUID = 2014101101L; @Override public void init(ServletConfig cfg) @@ -101,8 +101,6 @@ public class WeblogServlet extends HttpServlet { } if ( thisLastModified > lastModified ) lastModified = thisLastModified; - // O'Reilly recommends not using milliseconds part: - lastModified = (lastModified/1000)*1000; return new SingleBlogEntryPath(number, lastModified); } else return new NoSuchPath(); @@ -217,7 +215,7 @@ public class WeblogServlet extends HttpServlet { } if ( rp instanceof SingleBlogEntryPath ) { final long lastModified = ((SingleBlogEntryPath)rp).lastModified; - return lastModified; + return (lastModified/1000)*1000; } return -1; } -- cgit v1.2.3