From 0fb8126743bafee2518fb1a0c12877a6ad2690f3 Mon Sep 17 00:00:00 2001 From: Eylon Malin Date: Thu, 8 Aug 2019 18:01:34 +0300 Subject: set VID to use internally UTC timezone Issue-ID: VID-378 Signed-off-by: Eylon Malin Change-Id: I4b062d4a7ec68e564c46a094a75739dc9ad0355b --- .../java/org/onap/portalapp/conf/ExternalAppInitializer.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'epsdk-app-onap/src/main/java') diff --git a/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java b/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java index 7c1b5c693..ca317dde2 100644 --- a/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java +++ b/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java @@ -37,11 +37,12 @@ */ package org.onap.portalapp.conf; +import java.util.TimeZone; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; import org.onap.portalsdk.core.conf.AppInitializer; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; -import java.util.TimeZone; - public class ExternalAppInitializer extends AppInitializer { private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ExternalAppInitializer.class); @@ -54,6 +55,12 @@ public class ExternalAppInitializer extends AppInitializer { return new Class[] { appConfigClass }; } + @Override + public void onStartup(ServletContext servletContext) throws ServletException { + super.onStartup(servletContext); + setDefaultTimeZoneToUTC(); + } + //set time zone to UTC so Dates would be written to DB in UTC timezone private void setDefaultTimeZoneToUTC() { System.setProperty("user.timezone", "UTC"); -- cgit 1.2.3-korg