Operating System - HP-UX
1834055 Members
2386 Online
110063 Solutions
New Discussion

timezone settings tztab+java for iraq

 
Antonio Cardoso_1
Trusted Contributor

timezone settings tztab+java for iraq

Hi All,
I need to set the timezone for some HP-UX 11iv1 server in Baghdad (Iraq).
The standard/DST rules seem to be:
Standard time zone: UTC/GMT +3 hours
Daylight saving time: +1 hour : UTC/GMT +4

DST started on april 1 2007, 03 h 00 local DST ends on october 1 2007, 04 h 00 local
and same goes for other years.

It doesn't appear in the tztab.
I also need to have the correct mapping for java applications, and don't know how to check if it is OK or not.

Any help is welcome!

Thanks,
Antonio.
8 REPLIES 8
Jaime Bolanos Rojas.
Honored Contributor

Re: timezone settings tztab+java for iraq

Antonio, there is not reference in HP-UX for Daylight Saving time in Iraq.
I was not even aware that there was DST in iraq.

I think if you open a case with HP and prove there is a need of DST in Iraq, HP will pursuit the change given the bussines need.

P.S. Interesante, todavia quedaron servidores ahi despues de que EU destruyo practicamente a todos y todo por esa area.

Regards,

Jaime.
Work hard when the need comes out.
Marco A.
Esteemed Contributor

Re: timezone settings tztab+java for iraq

I believe that there will not be tztab for those places, actually for the java tzupdater application are resctrictions for that .:

http://www.hp.com/products1/unix/java/java2/jtk/exprot_compliance.html?jumpid=reg_R1002_USEN

I think that in this case the better option is a manual modification to the tztab file, but that could generate a lot of issues.

Rgds.
Just unplug and plug in again ....
Steven E. Protter
Exalted Contributor

Re: timezone settings tztab+java for iraq

Shalom Antonio,

GMT+3 will hae to do.

There are no localizations as far as I know. The government there is a little busy to set time zone policy and probably follows the policy of its neighbors.

If you are there, please be careful.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Antonio Cardoso_1
Trusted Contributor

Re: timezone settings tztab+java for iraq

Hi all,
thanks for your answers,
From what I know the DST rule has actually been applied on April 1st. Fall rule is Oct-1st at 3.

I tried to setup something in tztab:
IRQ-3IRQDST
0 4 1 4 1983-2038 0-6 IRQDST-4
0 3 1 10 1983-2038 0-6 IRQ-3

but this doesn't seem to work.
Moreover, the java timezone to use should be Asia/Baghdad, but I don't know how to link both.

NB: I'm not present in Baghdad, but thinking at a representative of my company who is there. Hoping nothing bad occurs with him.
Dennis Handly
Acclaimed Contributor

Re: timezone settings tztab+java for iraq

IRQ-3IRQDST
0 4 1 4 1983-2038 0-6 IRQDST-4
0 3 1 10 1983-2038 0-6 IRQ-3

>but this doesn't seem to work.

What do you mean? It seems you have it correct.

There was Clay's perl script in a thread around March that would help you test:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1106841
Antonio Cardoso_1
Trusted Contributor

Re: timezone settings tztab+java for iraq

Hello,

with tztab settings
> IRQ-3IRQDST
> 0 4 1 4 1983-2038 0-6 IRQDST-4
> 0 3 1 10 1983-2038 0-6 IRQ-3
Clay's script shows:
# /tmp/dst.pl
Sun Apr 01 01:59:59 IRQ 2007 --> Sun Apr 01 03:00:00 IRQDST 2007
Sun Oct 28 01:59:59 IRQDST 2007 --> Sun Oct 28 01:00:00 IRQ 2007

I don't understand what is wrong there:
- I expected DST transition to occur on Sun Apr 01 02:59:59 IRQ 2007 --> Sun Apr 01 04:00:00 IRQDST 2007
- back to standard time to occur on Mon Oct 01 03:59:59 --> Mon Oct 01 03:00:00

Moreover, the timezone name I found in java class TimeZone is sun.util.calendar.ZoneInfo[id="Asia/Baghdad",offset=10800000,dstSavings=3600000,useDaylight=true,transitions=114,lastRule=java.util.SimpleTimeZone[id=Asia/Baghdad,offset=10800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=1,startMonth=3,startDay=1,startDayOfWeek=0,startTime=10800000,startTimeMode=1,endMode=1,endMonth=9,endDay=1,endDayOfWeek=0,endTime=10800000,endTimeMode=1]]
This timezone seems to have the correct settings, as shown by test program:
DST 2007-03-31 23:59:59, local: 2007-04-01 02:59:59
DST 2007-04-01 00:00:00, local: 2007-04-01 04:00:00
DST 2007-09-30 23:59:59, local: 2007-10-01 03:59:59
DST 2007-03-31 00:00:00, local: 2007-10-01 03:00:00
but eventhough I achieve fixing it in tztab, do you know how to do the link betwenn UNIX and java timezone info?

thanks again.
antonio.
Dennis Handly
Acclaimed Contributor

Re: timezone settings tztab+java for iraq

>Clay's script shows: ...
>I don't understand what is wrong there:
>- I expected DST transition to occur on Sun Apr 01 02:59:59 IRQ 2007 --> Sun Apr 01 04:00:00 IRQDST 2007
>- back to standard time to occur on Mon Oct 01 03:59:59 --> Mon Oct 01 03:00:00

I get that:
$ TZ=IRQ-3IRQDST itrc_timezone.pl
Sun Apr 01 02:59:59 IRQ 2007 --> Sun Apr 01 04:00:00 IRQDST 2007
Mon Oct 01 03:59:59 IRQDST 2007 --> Mon Oct 01 03:00:00 IRQ 2007

(Did you remember to set TZ to your new zone?
Antonio Cardoso_1
Trusted Contributor

Re: timezone settings tztab+java for iraq

Now the tztab definition is working fine with definition above. I probably mistyped something during previous testings - as I did so many changes...

Now the issue is to make java applications recognize thiq new timezone as the "Asia/Baghdad" defined in ZoneInformation. At the moment, the only way I found is to set the TZ variable in startup scripts of my java applications running on this server.

Does anyone know another way to link tztab info with java's ZoneInfoMappings (/opt/java1.4/jre/lib/zi/ZoneInfoMappings )

thanks everybody!