Link to home
Start Free TrialLog in
Avatar of theideabulb
theideabulbFlag for United States of America

asked on

Timezone setting wrong on CF9 Server

I need to set the timezone in the jvm arguments to EST.  How can i do that?  I have been reading about setting the -Duser.timezone.  I am not sure how to set it
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In the administrative console, click Environment > WebSphere Variables\ .
Select the server for which you want to set the time zone value from the list of scope options.
Set a value for the TZ variable.
If the TZ variable is included in the list of defined variables, click TZ, and then specify a new time zone value in the Value field.

If the TZ variable is not included in the list of defined variables, click New, and then specify TZ in the Name field, and the appropriate time zone value in the Value field.

For example, if you specify TZ in the Name field, and EST5EDT in the Value field, Eastern Daylight Savings is used as the time zone setting for all of your server processes.

Click Apply, and then click Save to save your changes.
Stop and restart all of the affected application server that were running when you made the time zone changes.
You can pass the JVM this param -Duser.timezone, for example -Duser.timezone="Europe/Sofia" and this should do the trick. Setting the environment variable TZ might also help
use the JDK DST Timezone Update Tool - 1.3.25 (tzupdater) and then change the JVM parameter,the timezone information is stored by Windows in some registry
For example if you wanted to use PST, find the jvm.config file. Append "-Duser.timezone=America/Los_Angeles" to the beginning of the jvm args. Then restart CF.

# Arguments to VM
java.args=-server -Xmx512m -Duser.timezone=America/Los_Angeles -Dsun.io.useCanonCaches=false  (... rest of arguments ...)

Open in new window


To confirm the time zone was applied using:
<cfset tz = createObject("java", "java.lang.System").getProperty("user.timezone") >
<cfdump var="#tz#">
<cfdump var="#now()#">

Open in new window


Results:
America/Los_Angeles
(current date and time)

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of theideabulb

ASKER

That did it.. Thanks!