Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 31277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:34:46+00:00 2026-05-10T13:34:46+00:00

I am running a Tomcat application, and I need to display some time values.

  • 0

I am running a Tomcat application, and I need to display some time values. Unfortunately, the time is coming up an hour off. I looked into it and discovered that my default TimeZone is being set to:

sun.util.calendar.ZoneInfo[id='GMT-08:00',                            offset=-28800000,                            dstSavings=0,                            useDaylight=false,                            transitions=0,                            lastRule=null] 

Rather than the Pacific time zone. This is further indicated when I try to print the default time zone’s display name, and it comes up ‘GMT-08:00’, which seems to indicate to me that it is not correctly set to the US Pacific time zone. I am running on Ubuntu Hardy Heron, upgraded from Gutsy Gibbon.

Is there a configuration file I can update to tell the JRE to use Pacific with all the associated daylight savings time information? The time on my machine shows correctly, so it doesn’t seem to be an OS-wide misconfiguration.


Ok, here’s an update. A coworker suggested I update JAVA_OPTS in my /etc/profile to include ‘-Duser.timezone=US/Pacific’, which worked (I also saw CATALINA_OPTS, which I updated as well). Actually, I just exported the change into the variables rather than use the new /etc/profile (a reboot later will pick up the changes and I will be golden).

However, I still think there is a better solution… there should be a configuration for Java somewhere that says what timezone it is using, or how it is grabbing the timezone. If someone knows such a setting, that would be awesome, but for now this is a decent workaround.


I am using 1.5, and it is most definitely a DST problem. As you can see, the time zone is set to not use daylight savings. My belief is it is generically set to -8 offset rather than the specific Pacific timezone. Since the generic -8 offset has no daylight savings info, it’s of course not using it, but the question is, where do I tell Java to use Pacific time zone when it starts up? I’m NOT looking for a programmatic solution, it should be a configuration solution.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T13:34:46+00:00Added an answer on May 10, 2026 at 1:34 pm

    It’s a "quirk" in the way the JVM looks up the zoneinfo file. See Bug ID 6456628.

    The easiest workaround is to make /etc/localtime a symlink to the correct zoneinfo file. For Pacific time, the following commands should work:

    # sudo cp /etc/localtime /etc/localtime.dist # sudo ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime 

    I haven’t had any problems with the symlink approach.

    Edit: Added "sudo" to the commands.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running tomcat and have some jsp pages that display a subset of a
I'm running a Tomcat server with some virtual hosts and I need to POST
We're running a J2EE Application inside a Tomcat WebServer on AIX. We need to
I have an application running in tomcat that has a bunch of configuration files
I'm trying to add URL routing to a web application running in Tomcat 5.5.
Hi I have an application running in tomcat,as well as Weblogic and Websphere I
My J2EE based application running in Tomcat 6 on Solaris 10 sparc server is
I'm currently running my web application on Java1.5 codebase, running it on Tomcat 5.5
My main web application is on apache, but sometimes I need to import some
We have a legacy application running tomcat that publishes data in a simple html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.