Operating System - HP-UX
1753536 Members
6984 Online
108795 Solutions
New Discussion юеВ

DST: requiring changes for CTU-4

 
SOLVED
Go to solution
Yogeeraj_1
Honored Contributor

DST: requiring changes for CTU-4

Dear experts!

We have a site which would require changes such that DST is enable as from October 26, 2008.

Changes have been made to the HP-UX 11.11 server but when running a simple test, the time does not switch at the mentioned tick!

Below the configuration details:
[/etc/TIMEZONE]
===============
SERVER2:home>cat /etc/TIMEZONE
TZ=MUT-4
export TZ
SERVER2:home>

[/usr/lib/tztab]
================
SERVER2:home>tail /usr/lib/tztab
0 1 25-31 10 1970-1973 0 CSM6
0 1 24-30 11 1974 0 CSM6
0 1 25-31 10 1975-2038 0 CSM6

# Timezone MUT-4MUST

MUT-4MUST
0 3 25-31 10 2008-2038 0 MUST-5
0 1 25-31 3 2009-2038 0 MUT-4

SERVER2:home>


[Simple test]
=============
SERVER2:home>./test2.sh

Testing transition to DST on 26/10/08:
Sun Oct 26 01:59:00 MUT 2008
Sun Oct 26 01:59:15 MUT 2008
Sun Oct 26 01:59:30 MUT 2008
Sun Oct 26 01:59:45 MUT 2008
Sun Oct 26 02:00:00 MUT 2008
Sun Oct 26 02:00:15 MUT 2008
Done!
SERVER2:home>

[dst.pl]
========
Also tried Clay's script - does not show anything.

SERVER2:home> TZ=MUT-4MUST dst.pl
SERVER2:home>


NB. The server has already been restarted after the mentioned changes.

Did miss any steps?

Thanking you in advance for any guidances.

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
12 REPLIES 12
Dennis Handly
Acclaimed Contributor

Re: DST: requiring changes for CTU-4

>Also tried Clay's script

Great, you can test without rebooting.

MUT-4MUST
0 3 25-31 10 2008-2038 0 MUST-5
0 1 25-31 3 2009-2038 0 MUT-4

You need to specify both rules for every year, especially 2008.
Yogeeraj_1
Honored Contributor

Re: DST: requiring changes for CTU-4

Hi Dennis,

Thank you for the followup.

Made the changes as you mentioned but it is still not ok.

# Timezone MUT+4MUST

MUT-4MUST
0 1 25-31 3 2008 0 MUT-4
0 1 25-31 3 2009-2038 0 MUT-4
0 3 25-31 10 2008-2038 0 MUST-5


please advise further


kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Dennis Handly
Acclaimed Contributor

Re: DST: requiring changes for CTU-4

>Made the changes as you mentioned but it is still not ok.

I'll have to look at it when I get to work.
OldSchool
Honored Contributor

Re: DST: requiring changes for CTU-4

alright...first describe exactly when each transition should take place, and exactly what that transition is in terms of GMT or UCT. And what is the name of the Timezone

right now, it appears that you may have the rule set for 3:59am, and tested at 2, but I can't tell, and you've mentioned MST/MUT/CUT
Pete Randall
Outstanding Contributor

Re: DST: requiring changes for CTU-4

Actually, I thought it was set for 2:59 and the test was at 1:59.


Pete

Pete
OldSchool
Honored Contributor

Re: DST: requiring changes for CTU-4

0 3 25-31 10 2008-2038 0 MUST-5

I read that as "at 3:59 on the Sunday that occurs 10/25 - 10/31, change the time to GMT-5.

I think he's after Canadian Eastern, but I can't tell for sure. Note also, that he appears to have the transition to/from DST swapped from the usual order, which should make no difference, except I kept reading the wrong one....l.

My file (last year patch) has entries for #Canada, that might be what he needs...or not, since he hasn't yet specified what he's trying to get to....
TTr
Honored Contributor

Re: DST: requiring changes for CTU-4

> SERVER2:home> TZ=MUT-4MUST dst.pl
Is this what you typed exactly? try it again as I did it below.

What does your test2.sh do?

I added your entries to my /usr/lib/tztab and did
export TZ=MUT-4MUST
./dst.pl
and got the correct results
Sun Apr 06 01:59:59 MUT 2008 --> Sun Apr 06 03:00:00 MUST 2008
Sun Oct 26 01:59:59 MUST 2008 --> Sun Oct 26 01:00:00 MUT 2008
The "Sun Apr 06" is because the new DST entry starts in 2009 so it defaults Apr 06.

Dennis Handly
Acclaimed Contributor

Re: DST: requiring changes for CTU-4

>OldSchool: first describe exactly when each transition should take place, and exactly what that transition is in terms of GMT or UTC. And what is the name of the Timezone

I think Yogeeraj already did that by his tztab entry and his output from his tool. :-)
But it never hurts to be this precise.

>it appears that you may have the rule set for 3:59am, and tested at 2, but I can't tell

No, this jumps from 1:59 to 3. I.e. the result AFTER the change.

>OldSchool:
>0 3 25-31 10 2008-2038 0 MUST-5
>I read that as "at 3:59 on the Sunday that occurs 10/25 - 10/31, change the time to GMT-5.

No, it's at 1:59 change to 3 for UTC-5.

>I think he's after Canadian Eastern

Why? With N logical inferences, you should know that Yogeeraj is in the southern hemisphere where everything is upside down and he is ahead of GMT.

You do know there could be (24*3)+ timeszones?

>that he appears to have the transition to/from DST swapped from the usual order,

That may be the issue but he is upside down and he did say: DST is enable as from October 26, 2008.

>TTr: got the correct results

Yes, I got those results on 11.23.
But without that extra 2008 rule, it would look like:
Sun Mar 30 01:59:59 MUST 2008 --> Sun Mar 30 01:00:00 MUT 2008
Yogeeraj_1
Honored Contributor

Re: DST: requiring changes for CTU-4

Hi again,

First of all, thank you everyone for comments and analysis. Thank you Dennis for the precision and clarifications on my behalf. Yes. We are in the Southern Hemisphere. ( ..where everything is upside down?? :) )

Coming back to the problem, we are doing a BRUTE FORCE test by actually rolling forward the time and let the clock tick through the defined transition.


TTr:
====
Thank your input.

As per your reply, We find that we will need to set our TZ variable to MUT-4MUST for this to work properly.

Now, the following questions:
QU. What should we put in the /etc/TIMEZONE file? (TZ=MUT-4MUST ?)
QU. What will happen if we restart the server between October 26, 2008 and March 29, 2009?




here is the code in the script:

SERVER2:home>cat test2.sh
#!/bin/ksh
# date [MMDDhhmm[[CC]YY][.ss]]
#
# NB. TO BE USED WITH CAUTION.
# NB. TO BE USED WITH CAUTION.
# NB. TO BE USED WITH CAUTION.
# NB. TO BE USED WITH CAUTION.
# NB. TO BE USED WITH CAUTION.
# NB. TO BE USED WITH CAUTION.
# NB. TO BE USED WITH CAUTION.
# All databases, applications,etc should be shutdown prior to tests.
# 01/10/2008-YD
#
# First loop test - set the date to 01:59:00 on 26/10/08
# and display the date every 15 seconds for a minute
# and a half.
export TZ=MUT-4MUST
echo "\nTesting transition to DST on 26/10/08:"
lcv1=6

if [ $(whoami) = "root" ]
then
## date [MMDDhhmm[[CC]YY][.ss]]
date 102601592008 > /dev/null
fi

while (( lcv1 > 0 ))
do
let lcv1-=1
date
if [ "$lcv1" = 0 ]
then
break
fi
sleep 15
done

# Second loop test - set the date to 00:59:00 on 29/03/09
# and display the date every 60 seconds for a minute
# and a half.
# NB. TZ should be in MUST so that switch to MUT is performed.
#
echo "\nTesting transition back from DST on 29/03/09:"
lcv2=120

if [ $(whoami) = "root" ]
then
## date [MMDDhhmm[[CC]YY][.ss]]
date 032900592009 > /dev/null
fi

while (( lcv2 > 0 ))
do
let lcv2-=1
date
if [ "$lcv2" = 0 ]
then
break
fi
sleep 60
done

echo "Done!"
# NB. TO BE USED WITH CAUTION.
# NB. TO BE USED WITH CAUTION.
# NB. TO BE USED WITH CAUTION.
# NB. TO BE USED WITH CAUTION.
SERVER2:home>


Below the results when we run the script:
=========================================
SERVER2:home>./test2.sh

Testing transition to DST on 26/10/08:
Sun Oct 26 01:59:00 MUT 2008
Sun Oct 26 01:59:15 MUT 2008
Sun Oct 26 01:59:30 MUT 2008
Sun Oct 26 01:59:45 MUT 2008
Sun Oct 26 03:00:00 MUST 2008
Sun Oct 26 03:00:15 MUST 2008

Testing transition back from DST on 29/03/09:
Sun Mar 29 00:59:00 MUST 2009
Sun Mar 29 01:00:00 MUST 2009
Sun Mar 29 01:01:00 MUST 2009
Sun Mar 29 01:02:00 MUST 2009
Sun Mar 29 01:03:00 MUST 2009
Sun Mar 29 01:04:00 MUST 2009
Sun Mar 29 01:05:00 MUST 2009
Sun Mar 29 01:06:00 MUST 2009
Sun Mar 29 01:07:00 MUST 2009
Sun Mar 29 01:08:00 MUST 2009
Sun Mar 29 01:09:00 MUST 2009
Sun Mar 29 01:10:00 MUST 2009
...
Sun Mar 29 01:43:00 MUST 2009
Sun Mar 29 01:44:00 MUST 2009
Sun Mar 29 01:45:00 MUST 2009
Sun Mar 29 01:46:00 MUST 2009
Sun Mar 29 01:47:00 MUST 2009
Sun Mar 29 01:48:00 MUST 2009
Sun Mar 29 01:49:01 MUST 2009
Sun Mar 29 01:50:01 MUST 2009
Sun Mar 29 01:51:01 MUST 2009
Sun Mar 29 01:52:01 MUST 2009
Sun Mar 29 01:53:01 MUST 2009
Sun Mar 29 01:54:01 MUST 2009
Sun Mar 29 01:55:01 MUST 2009
Sun Mar 29 01:56:01 MUST 2009
Sun Mar 29 01:57:01 MUST 2009
Sun Mar 29 01:58:01 MUST 2009
Sun Mar 29 01:59:01 MUST 2009
Sun Mar 29 01:00:01 MUT 2009
Sun Mar 29 01:01:01 MUT 2009
Sun Mar 29 01:02:01 MUT 2009
Sun Mar 29 01:03:01 MUT 2009
Sun Mar 29 01:04:01 MUT 2009
Sun Mar 29 01:05:01 MUT 2009
..
SERVER2:home>

TTr:
====
When we run the script as you mention, we now get:

SERVER2:home> export TZ=MUT-4MUST
SERVER2:home> date
Tue Oct 14 09:11:17 MUT 2008
SERVER2:home> ./dst.pl -y 2008
Sun Oct 26 01:59:59 MUT 2008 --> Sun Oct 26 03:00:00 MUST 2008
SERVER2:home> ./dst.pl -y 2009
Sun Mar 29 01:59:59 MUST 2009 --> Sun Mar 29 01:00:00 MUT 2009
Sun Oct 25 01:59:59 MUT 2009 --> Sun Oct 25 03:00:00 MUST 2009
SERVER2:home>


kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)