Operating System - HP-UX
1752286 Members
4984 Online
108786 Solutions
New Discussion юеВ

TZ+DST in the /etc/TIMEZONE FILE

 
SOLVED
Go to solution
Md. Minhaz Khan
Super Advisor

TZ+DST in the /etc/TIMEZONE FILE

Dear Concern,

Bangladesh government announced from 19th June, 2009 time will be one hour ahead from present time. At 19th June 2009 Bangladesh time changed 23.00 to 00.00 (20th June 2009).

So
At Friday, June 19 at 23:00:00 hour local clock time will forward to one hour from 23:00 to 00.00(20th June 2009 00:00:00)

At Thursday, October 1 at 00:00:00 hour Local clock time will be one hour backward from 00:00 to 23:00 (30th September 23:00:00)

For Bangladesh we are in UTC+6 zone (TZ=BDT-6).
We are using HP-UX B.11.11. In the /usr/lib/tztab file we did not find any time zone that we use for DST for Bangladesh region.

I have got an action plan to implement above DST rules into /etc/TIMEZONE file. Please correct me if below action plan was wrong and verify the below action plan for the above new DST rules in Bangladesh

Step 1:

#vi /etc/TIMEZONE

TZ=:BDT-6BDT-7,M6.3.5/23:00:00,M10.1.5/00:00:00
export TZ

:wq!

Step 2: Edit /usr/lib/tztab file.

# vi /usr/lib/tztab

give # sign in-front all lines.

:wq!

Step 3:
#sam
Check whether the system supports the DST.
If the version of the operating system is B11.11 or earlier, choose Kernal Configuration > Configurable Parameters.
Query for the value in the Current Value column of the dst parameter.
0: It indicates that the system does not support the DST.
1: It indicates that the system supports the DST---->Should be 1, if not modify it to 1, then reboot

Step 4:

#shutdown -ry 0


**Note: I know best solution is to edit /usr/lib/tztab file or request to HP to give us a patch for DST in Bangladesh.But HP delays.

Thanks in advance

Minhaz
8 REPLIES 8
Dennis Handly
Acclaimed Contributor

Re: TZ+DST in the /etc/TIMEZONE FILE

Instead of creating a new thread, you should copy your new info into your previous thread:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1345763

>Bangladesh government announced from 19th June, 2009 time

When does it happen next year?
Do you have an official government document/URL? Have you talked to the Response Center?

>For Bangladesh we are in UTC+6 zone (TZ=BDT-6).

What are the names of your two zones?

>I have got an action plan to implement above DST rules into /etc/TIMEZONE file.

I wouldn't bother with changing /etc/TIMEZONE since it may not work next year. I would just change tztab(4).

>BDT-6BDT-7

This is NOT a good idea to use the same zone names. You can't tell the difference when you ask for the date. In the US, we have EST-5EDT.

>Step 2: Edit /usr/lib/tztab file.
>give # sign in-front all lines.

Don't do that! If you aren't adding an entry for your timezones, leave this file alone.

>Step 3: Check whether the system supports the DST.

Yes, it would be a good idea to check this.

>**Note: I know best solution is to edit /usr/lib/tztab file

That's the best solution.
You should be able to do this after reading about the tztab(4) format.
Md. Minhaz Khan
Super Advisor

Re: TZ+DST in the /etc/TIMEZONE FILE

Dear Dennis

>>When does it happen next year?

It is was confirmed by our government.

>>Do you have an official government document/URL? Have you talked to the Response Center?

Our government send us only a formal email that we need to ahead 1 hour time at 19th June 23:00 to 00:00 (20th june 2009)

>>What are the names of your two zones?

As mentioned earlier for Bangladesh we have
no valid time zone. Bangladesh is in UTC+6 so we put TZ variable in the /etc/TIMEZONE file TZ=BDT-6
export TZ

>>>BDT-6BDT-7

Ok we will change it form BDT-6BDT-7 to BST-6BDT-7

>>>Step 2: Edit /usr/lib/tztab file.

Ok we will not touch /usr/lib/tztab file

>>I wouldn't bother with changing /etc/TIMEZONE since it may not work next year. I would just change tztab(4).

For the next year if government will continue DST then we will go for permanent solution by requesting HP to give us patch.

So Dennis or any other person please tell me the action plan that i previously post is correct for only this year 2009 or not??

I am sorry that i am not able to show you government URL because our government only send us a formal email.


Thanks
Minhaz
Md. Minhaz Khan
Super Advisor

Re: TZ+DST in the /etc/TIMEZONE FILE

Dear Dennis

>>When does it happen next year?

**It is not confirmed by our government.
Md. Minhaz Khan
Super Advisor

Re: TZ+DST in the /etc/TIMEZONE FILE

Dear Dennis

As per your instruction i have read "man tztab"

As for Bangladesh there is no specific Time Zone Entry in HP-UX B.11.11. I have made an action plan of my own. May be i am wrong.If wrong please correct me and give me a right way.

Our current scenario is as per government instruction:

At Friday, June 19 at 23:00:00 hour local clock time will forward to one hour from 23:00 to 00.00(20th June 2009 00:00:00)

At Thursday, October 1 at 00:00:00 hour Local clock time will be one hour backward from 00:00 to 23:00 (30th September 23:00:00)


Step 1:

#vi /etc/TIMEZONE

TZ=BGH-6-->We define it as per our Time Zone
export TZ

:wq!


Step 2:

#cd /usr/lib
#cp -p tztab tztab_bak
#vi tztab
..........
........
#Bangladesh Day Light Savings Time
BGH-6BGHDST
0 23 19 6 2008 5 BGHDST-7
0 0 1 10 2008 4 BGH-6

:wq!

Step 3:
#shutdown -ry 0
Dennis Handly
Acclaimed Contributor

Re: TZ+DST in the /etc/TIMEZONE FILE

>Our government send us only a formal email that we need to ahead 1 hour time at 19th June 23:00 to 00:00 (20th june 2009)

I guess you have sent this on to HP?

>we will change it from BDT-6BDT-7 to BST-6BDT-7

Have you told HP about this string? BST-6BDT

>we will not touch /usr/lib/tztab file

I'm suggesting you add BST-6BDT there.

>For the next year if government will continue DST

This can be setup to only do one year.

>As for Bangladesh there is no specific Time Zone Entry

You can add one.

>TZ=BGH-6 -->We define it as per our Time Zone
>#Bangladesh Day Light Savings Time
BGH-6BGHDST
00 23 19 06 2008 5 BGHDST-7
00 00 01 10 2008 4 BGH-6

I don't think this will work. You can use Clay's dst.pl to check.
Dennis Handly
Acclaimed Contributor
Solution

Re: TZ+DST in the /etc/TIMEZONE FILE

Here are the tztab entries:
#Bangladesh Day Light Savings Time
BGH-6BGHDST
00 00 20 06 2009 0-6 BGHDST-7
00 23 30 09 2009 0-6 BGH-6

$ TZ=BGH-6BGHDST dst.pl
Fri Jun 19 22:59:59 BGH 2009 --> Sat Jun 20 00:00:00 BGHDST 2009
Wed Sep 30 23:59:59 BGHDST 2009 --> Wed Sep 30 23:00:00 BGH 2009
Md. Minhaz Khan
Super Advisor

Re: TZ+DST in the /etc/TIMEZONE FILE

Dennis thanks a lot.Please help me how can i get "dst.pl" script??

As mentioned earlier that For Bangladesh there is no specific time zone and also no definition in the /usr/lib/tztab file, so the solution that you give us would work or not?

If you toled me to test, i can test it in my test server.

Thanks
Minhaz
Dennis Handly
Acclaimed Contributor

Re: TZ+DST in the /etc/TIMEZONE FILE

>how can I get "dst.pl" script?

In your other thread I mentioned this script with this URL:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1260910

That thread points to a bunch of others, one should have it attached. After following the links and getting dizzy:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1165833

>so the solution that you give us would work or not?

I tested it with dst.pl and it should work.

>I can test it in my test server.

Sure go ahead. Make sure you save a copy of tztab.