Search code examples
jbossjboss7.x

How to change jboss timezone?Java property is not working


it seems the jboss is using dates as UTC, I verified this by simply doing:

log.info(new Date());

And I get the UTC time.

So, in order to change it I added to standalone.conf the following property:

-Duser.timezone=Europe/Rome

But it's still not working! Any other idea?


Solution

  • Just complementing Panagiotis answer:

    <system-properties>
            <property name="user.timezone" value="GMT"/>
    </system-properties>
    

    For Standalone

    Linux/Unix: add to the user.timezone system property in standalone.conf Microsoft: same thing but on standalone.conf.bat file.

    Cli command to change the timezone

    Or even set as JVM parameter directly:

    ./standalone.sh -Duser.timezone=UTC

    To verify

    /core-service=platform-mbean/type=runtime:read-attribute(name=system-properties)