Setting Server Timezone

By default LAMS will use whatever timezone is set in the server/box you are running it. However, if you want to change this, you can do so by changing the timezone for the Java Virtual Machine (JVM).

If you wan to change the time zone, add the following to your JBoss starting script:

-Duser.timezone=GMT[-+delta] 


Where [-+delta] is -3 or +10 or etc according to your GMT location.

You can also specify the timezone by its timezone ID (see full list) instead:


-Duser.timezone="Australia/Sydney"


The advantage of specifying the timezone ID is that it will take into account Daylight Savings Time for that specific timezone. So in the specific timezone for Australia/Sydney, Datelight Saving Time will apply on last Sunday in October until last Sunday in March. These changes will take place automatically based on the timezone data in the JVM. To update the timezone data in Java see the Timezone Updater Tool

In Windows

If you used the LAMS Windows installer, you will need to modify the wrapper.conf file which it's in the C:\lams2\jboss-4.0.2\conf directory (if you install LAMS in C:\lams2 -of course). In this file search for the Java Additional Parameters and add the last line (wrapper.java.additional.3) as shown here:

# Java Additional Parameters
wrapper.java.additional.1=-Dprogram.name=run.bat
wrapper.java.additional.2=-XX:MaxPermSize=256m
wrapper.java.additional.3=-Duser.timezone=GMT+11

Note that this sets the server time to GMT+11. Change this to whatever timezone you want your server to be in. Save the changes and restart LAMS.

In Linux/Unix

If you used the installer, find the run-lams.sh file in the directory where you installed LAMS and add the -Duser.timezone=GMT+11 line to the JAVA_OPTS:

export JAVA_OPTS="-server -Xmx512m -XX:MaxPermSize=128m -XX:MaxNewSize=204m -XX:SurvivorRatio=32 -Duser.timezone=GMT+11"

Restart the server and voila!