package br.edu.ifpb.nutrif.servlet;

import java.util.Calendar;
import java.util.TimeZone;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

@WebListener
public class TimeZoneListener implements ServletContextListener {

	private static Logger logger = LogManager.getLogger(TimeZoneListener.class);

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
    	
		// Timezone para o Nordeste do Brasil.
    	TimeZone.setDefault(TimeZone.getTimeZone("America/Fortaleza"));
    	
    	// Verificao.
    	Calendar now = Calendar.getInstance();
    	logger.info("--------- TimeZone ----------");
        logger.info(now.getTimeZone());
        logger.info(now.getTime());
        logger.info("-----------------------------");

	}
	
	@Override
	public void contextDestroyed(ServletContextEvent arg0) {}
}

@@ -580,20 +580,17 @@
 Brasil.%0A
-    
+%09
 %09TimeZon
@@ -628,25 +628,11 @@
 ne(%22
-America/Fortaleza
+UTC
 %22));

Ajuste no timezone da aplicação de serviço.