Time Zone on WebLogic Server

Posted by adejuanc on Oracle Blogs See other posts from Oracle Blogs or by adejuanc
Published on Tue, 9 Oct 2012 21:43:27 +0000 Indexed on 2012/10/10 3:46 UTC
Read the original article Hit count: 353

Filed under:

In order to configure the time zone with WebLogic Server, use the following JVM startup command:

-Duser.timezone=<timezone>

For example, in the java arguments in the admin console at Environments -> Servers -> Servername -> - Server Start tab, configure the startup settings that Node Manager will use to start the particular server. For example:

-Duser.timezone='America/Arizona'

There are many different time zones, each with its own code. For a complete list please refer to :

http://en.wikipedia.org/wiki/List_of_zoneinfo_time_zones

For testing, you can run the following code on WLS with a JSP, servlet, or deploying the class:

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

public class TestTimeZone {

 public static void main(String[] args) {

   Calendar calendar = Calendar.getInstance();

   TimeZone timeZone = calendar.getTimeZone();

   System.out.println(" your Current TimeZone is : " + timeZone.getDisplayName());
   System.out.println(" Time Zone id : "+ timeZone.getID());

 }
}

© Oracle Blogs or respective owner

Related posts about /Oracle