Time Zone on WebLogic Server

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());

 }
}
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Antonio De Juan Image

I was formerly a Senior Technical Support Engineer in the Middleware Application Server Team. I worked supporting Weblogic Server, Java EE, Jrockit, Coherence among other Oracle products.
You can find my new blog at :
http://antoniodejuan.wordpress.com/
Oracle WebLogic

Search

Categories
Archives
« June 2015
SunMonTueWedThuFriSat
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today