[java-identity-provider] branch master updated: Formatters need UTC time zone set if not using local time.

Scott Cantor cantor.2 at osu.edu
Fri Mar 29 12:41:56 EDT 2019


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=7a6555618c37a1b839bd455a109c1d7f0fbd34ea

The following commit(s) were added to refs/heads/master by this push:
       new  7a65556   Formatters need UTC time zone set if not using local time.
7a65556 is described below

commit 7a6555618c37a1b839bd455a109c1d7f0fbd34ea
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Mar 29 12:41:53 2019 -0400

    Formatters need UTC time zone set if not using local time.
---
 .../net/shibboleth/idp/profile/audit/impl/PopulateAuditContext.java    | 3 +++
 .../main/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLog.java | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/PopulateAuditContext.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/PopulateAuditContext.java
index 272fa3a..4f3f789 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/PopulateAuditContext.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/PopulateAuditContext.java
@@ -18,6 +18,7 @@
 package net.shibboleth.idp.profile.audit.impl;
 
 import java.time.ZoneId;
+import java.time.ZoneOffset;
 import java.time.format.DateTimeFormatter;
 import java.time.temporal.TemporalAccessor;
 import java.util.Collection;
@@ -215,6 +216,8 @@ public class PopulateAuditContext extends AbstractProfileAction {
         
         if (useDefaultTimeZone) {
             dateTimeFormatter = dateTimeFormatter.withZone(ZoneId.systemDefault());
+        } else {
+            dateTimeFormatter = dateTimeFormatter.withZone(ZoneOffset.UTC);
         }
     }
 
diff --git a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLog.java b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLog.java
index 6a96fff..66f9b2c 100644
--- a/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLog.java
+++ b/idp-profile-impl/src/main/java/net/shibboleth/idp/profile/audit/impl/WriteAuditLog.java
@@ -19,6 +19,7 @@ package net.shibboleth.idp.profile.audit.impl;
 
 import java.time.Instant;
 import java.time.ZoneId;
+import java.time.ZoneOffset;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -199,6 +200,8 @@ public class WriteAuditLog extends AbstractProfileAction {
         
         if (useDefaultTimeZone) {
             dateTimeFormatter = dateTimeFormatter.withZone(ZoneId.systemDefault());
+        } else {
+            dateTimeFormatter = dateTimeFormatter.withZone(ZoneOffset.UTC);
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list