Commit 15e98837 authored by Christian Schudt's avatar Christian Schudt

XEP-0202 Entity Time should respect Daylight Saving Time

Fixes OF-932
parent ddf3fb28
...@@ -71,7 +71,7 @@ public final class IQEntityTimeHandler extends IQHandler implements ServerFeatur ...@@ -71,7 +71,7 @@ public final class IQEntityTimeHandler extends IQHandler implements ServerFeatur
*/ */
String formatsTimeZone(TimeZone tz) { String formatsTimeZone(TimeZone tz) {
// package-private for test. // package-private for test.
int seconds = Math.abs(tz.getRawOffset()) / 1000; int seconds = Math.abs(tz.getOffset(System.currentTimeMillis())) / 1000;
int hours = seconds / 3600; int hours = seconds / 3600;
int minutes = (seconds % 3600) / 60; int minutes = (seconds % 3600) / 60;
return (tz.getRawOffset() < 0 ? "-" : "+") + String.format("%02d:%02d", hours, minutes); return (tz.getRawOffset() < 0 ? "-" : "+") + String.format("%02d:%02d", hours, minutes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment