Time Zone on WebLogic Server
- by adejuanc
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());
}
}