From 18144043e659be753e1d3a157c20c4080ec8dcf5 Mon Sep 17 00:00:00 2001 From: hermens Date: Tue, 30 Oct 2007 19:20:02 +0000 Subject: [PATCH] Correct UTC Offset at beginning/end of daylight savings time git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4185 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/server/serverDate.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/de/anomic/server/serverDate.java b/source/de/anomic/server/serverDate.java index 16c4b0c68..46b3d068f 100644 --- a/source/de/anomic/server/serverDate.java +++ b/source/de/anomic/server/serverDate.java @@ -204,6 +204,9 @@ public final class serverDate { } public static long UTCDiff() { + // DST_OFFSET is dependent on the time of the Calendar, so it has to be updated + // to get the correct current offset + thisCalendar.setTimeInMillis(System.currentTimeMillis()); long zoneOffsetHours = thisCalendar.get(Calendar.ZONE_OFFSET); long DSTOffsetHours = thisCalendar.get(Calendar.DST_OFFSET); return zoneOffsetHours + DSTOffsetHours;