cancel
Showing results for 
Search instead for 
Did you mean: 

Java Timezone And TZTAB

SOLVED
Go to solution
AZayed
Super Advisor

Java Timezone And TZTAB

Dear Sys Admins,
Good day,

I have a critical issue with our HP-UX systems. Recently we created a new timezone for Syria called "EET-2EEST" in our tztab. Now the system function well but I have an issue with the JAVA. We are using java 1.5 on HP-UX 11.23

As I read java will try to get the right TZ value and compare it with it's internal tzmappings file. The issue is this new TZ not in this file + Asia/Damascus is a not a timezone in our tztab file. So, the java will return to GMT.

How can I recompile /opt/java1.5/jre/lib/tzmappings file to contain the new created timezone ?

I have already used tzupdater tool but I didn't see it useful in my case.

Thanks a lot.
Success seems to be connected with action. Successful people keep moving. They make mistakes, but they don't quit.
12 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: Java Timezone And TZTAB

Hi:

Google suggests that this might help:

http://www.jdocs.com/javase/7.b12/java/util/TimeZone.html

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Java Timezone And TZTAB

>we created a new timezone for Syria called "EET-2EEST" in our tztab. I have an issue with the JAVA. Asia/Damascus

Have you talked to HP about adding this to Java and tztab(4)?

I'm not sure if this would have all of the timezone data?
http://java.sun.com/javase/tzupdater_README.html
AZayed
Super Advisor

Re: Java Timezone And TZTAB

Hi JRF, Thanks for reply. I will check this tomorrow. I don't have any knowledge with Java.

Dear Dennis, I didn't talked with HP, but I have this idea in my mind. However, I'm trying to be creative. Also, I have already read this article.

Thanks
Success seems to be connected with action. Successful people keep moving. They make mistakes, but they don't quit.
TTr
Honored Contributor

Re: Java Timezone And TZTAB

Did anything change in Syria this year?

My java 1.5 on my hp-ux 11.11 has Asia/Damascus entry in the time zone library

/opt/java1.5/jre/lib/zi/Asia/Damascus

> How can I recompile /opt/java1.5/jre/lib/tzmappings file to contain the new created timezone ?

You don't. Java does not use tztab, it has it own internal time zone library.

What exactly is the problem? Some applications supply their own java environment and they will not use /opt/java1.5/
AZayed
Super Advisor

Re: Java Timezone And TZTAB

Hi TTr,

The issue is we don't have a rule for DST change. Every year the government decide this before 2 weeks. So, HP / SUN and Microsoft don't provide a patch for Syria Timezone. For our UNIX based system we are updating the files manually.

For SUN we are using zic command. For HP-UX we are using tztab.

Now, we have one application based on JAVA has an issue with the new timezone "EET-2EEST" because JAVA don't have this timezone in it's internal database. I checked tzupdater for HP-UX they don't provide update for Syria but the SUN website contain a patch for java to solve this issue.

But this issue will continue to happen over and over because we don't have a standard rule. That's why we created a new timezone. And we hope to do the same for the Java.

I would like to figure out how I can add this line to tzmappings file and compile it :

EET-2EEST Asia/Damascus

Thanks a lot.
Success seems to be connected with action. Successful people keep moving. They make mistakes, but they don't quit.
TTr
Honored Contributor

Re: Java Timezone And TZTAB

Understood. I am not aware of any tools that would allow you to edit an existing timezone definition in java or create a new definition to replace an existing one. Other than going through the official channels and report it so that it might be included in the next fix, your only option is to get access to the Java source code and see if you can do something there.
The tzmappings is only a lookup table between old and new timezone names for java. It will not do what you want.
Dennis Handly
Acclaimed Contributor

Re: Java Timezone And TZTAB

>Every year the government decide this before 2 weeks. So, HP / SUN and Microsoft don't provide a patch for Syria Timezone.

Do you have an official government document giving the details of the exact date/time for the change? You need this if you want HP to update tztab(4).

I assume you've used Clay's dst.pl to check your tztab(4) changes?

>we have one application based on JAVA has an issue with the new timezone "EET-2EEST" because JAVA don't have this timezone in its internal database.

Why would you use "EET-2EEST" instead of Asia/Damascus?

>but the SUN website contain a patch for java to solve this issue.

Does that work?

>TTr: I am not aware of any tools that would allow you to edit an existing timezone definition in java or create a new definition to replace an existing one.

Hmm, I would expect java to have such a tool. Perhaps the are keeping it hidden so customers know that the result is "official"?
AZayed
Super Advisor

Re: Java Timezone And TZTAB

Hi Dennis,
Hope you doing well.

I didn't hear of "Clay's dst.pl" but I would give it a try.

However, I don't want to use Asia/Damascus TZ because it's not accurate. We used zic command to update asia file under Solaris but for HP-UX we ended-up with creating this new TZ to be controlled by us.
Success seems to be connected with action. Successful people keep moving. They make mistakes, but they don't quit.
Dennis Handly
Acclaimed Contributor
Solution

Re: Java Timezone And TZTAB

>I didn't hear of "Clay's dst.pl" but I would give it a try.

See his attachment here:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1165833

>I don't want to use Asia/Damascus TZ because it's not accurate.

That's why you need to contact HP so it is.
AZayed
Super Advisor

Re: Java Timezone And TZTAB

Hi Dennis,
Hope you doing well.

I hope to find out if you have any information to help me out with this issue.

Thanks a lot.
Success seems to be connected with action. Successful people keep moving. They make mistakes, but they don't quit.
Dennis Handly
Acclaimed Contributor

Re: Java Timezone And TZTAB

>AZayed: I hope to find out if you have any information to help me out with this issue.

Again, you need to contact HP to get this Java timezone added.
AZayed
Super Advisor

Re: Java Timezone And TZTAB

Hi Dennis,
I'm going to call HP for this.

Thanks
Success seems to be connected with action. Successful people keep moving. They make mistakes, but they don't quit.