Operating System - HP-UX
1833760 Members
2631 Online
110063 Solutions
New Discussion

How to handle the DST changes for 2008(HP-UX)

 
skt_skt
Honored Contributor

How to handle the DST changes for 2008(HP-UX)

I am trying to collect information "Patch requierment/apply to handle the DST changes for 2008(both mar and Nov)"

I am looking for a dicussion covering all HP-UX version (10.20 to 11.31); what are the precaution to take for the pathcing; Any need of appl/db bouncing etc..

I hope this is going to be very intersing since it is a very good Topic for UNIX admins.
14 REPLIES 14
James R. Ferguson
Acclaimed Contributor

Re: How to handle the DST changes for 2008(HP-UX)

Hi:

This subject has been beaten to death during 2007. Search the ITRC Forums and you will find more threads than you will need to understand this:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1105753&admit=109447626+1199321945908+28353475

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1165198&admit=109447626+1199321985287+28353475

...are but two I found by providing the keyword "DST" in an ITRC Forum Search!

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: How to handle the DST changes for 2008(HP-UX)

As mentioned by JRF, you should have already done this last year when it changed for Y2K7.

In case it's not obvious, the tztab(4) format lets you patch /usr/lib/tztab once, for a given pattern and only needs to be changed when the politicians get busy. :-)

Of course there are always new changes, Venezuela, possibly Newfoundland and New Zealand that may have more patches.

For Y2K7 there is a special website for all of HP:
http://www.hp.com/go/dst
skt_skt
Honored Contributor

Re: How to handle the DST changes for 2008(HP-UX)



Could anyone paste the EST5EST portion from the /usr/lib/tztab ?( who have the patches PHCO_37053 or PHCO_35989)
Pete Randall
Outstanding Contributor

Re: How to handle the DST changes for 2008(HP-UX)

# Eastern Standard Time, Eastern Daylight Time
EST5EDT
0 3 24-30 4 1970-1973 0 EDT4
0 3 6 1 1974 0-6 EDT4
0 3 22-28 2 1975 0 EDT4
0 3 24-30 4 1976-1986 0 EDT4
0 3 1-7 4 1987-2006 0 EDT4
0 3 8-14 3 2007-2038 0 EDT4
0 1 25-31 10 1970-1973 0 EST5
0 1 24-30 11 1974 0 EST5
0 1 25-31 10 1975-2006 0 EST5
0 1 1-7 11 2007-2038 0 EST5


Pete

Pete
skt_skt
Honored Contributor

Re: How to handle the DST changes for 2008(HP-UX)

Those clearly tell the DST changes for years 2007-2038 are already covered with the below entries. So we dont need to worry unless the government changes the current scedule.

am i right?

0 3 8-14 3 2007-2038 0 EDT4

0 1 1-7 11 2007-2038 0 EST5


Also i do have the sam entries with patch/PHCO_34668.

47 # Eastern Standard Time, Eastern Daylight Time
48 EST5EDT
49 0 3 24-30 4 1970-1973 0 EDT4
50 0 3 6 1 1974 0-6 EDT4
51 0 3 22-28 2 1975 0 EDT4
52 0 3 24-30 4 1976-1986 0 EDT4
53 0 3 1-7 4 1987-2006 0 EDT4
54 0 3 8-14 3 2007-2038 0 EDT4
55 0 1 25-31 10 1970-1973 0 EST5
56 0 1 24-30 11 1974 0 EST5
57 0 1 25-31 10 1975-2006 0 EST5
58 0 1 1-7 11 2007-2038 0 EST5
So does that mean i dont need to apply the patch as of now(before the scheduled DST change in 03/09/2007); right?
skt_skt
Honored Contributor

Re: How to handle the DST changes for 2008(HP-UX)

i meant 03/09/2008..
Dave Hutton
Honored Contributor

Re: How to handle the DST changes for 2008(HP-UX)

You can answer the question yourself by looking at a thread you already posted it:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1165198

Run Clays perl script and it'll tell you if your fine.

If your concerned about Java, theres this:
http://www.hp.com/products1/unix/java/DST-US.html

within that tool lets you verify your java also.
Pete Randall
Outstanding Contributor

Re: How to handle the DST changes for 2008(HP-UX)

The DST patches covered other things besides just the tztab entries and new patches were issued to refine those other corrections - not to change the tztab. Once you've applied a DST patch, you're done, as far as tztab is concerned.


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: How to handle the DST changes for 2008(HP-UX)

Hi (again):

> So does that mean i dont need to apply the patch as of now(before the scheduled DST change in 03/09/2008); right?

There are NO CHANGES for EST5EST for this year. You can clearly see that from the entries:

0 3 8-14 3 2007-2038 0 EDT4
0 1 1-7 11 2007-2038 0 EST5

...which tell you that the rule beginning 2007 is applicable through 2038 (when 32-bit time-keeping falls apart).

Read the manpages for 'tztab(4)' to better understand the format of this file and the amount of information in conveys.

As for asking someone to *post* the contents of the 'tztab' patch, you don't have to do that. For example, using an 11.11 patch:

# sh PHCO_37053.htm

# tar -xvf PHCO_37053.depot

# mv PHCO_37053/UX-CORE/usr/newconfig/usr/lib/tztab PHCO_37053/UX-CORE/usr/newconfig/usr/lib/tztab.gz

...Note that the 'tztab' needs to be renamed and decompressed, so having renamed it, now do:

# gzip -d PHCO_37053/UX-CORE/usr/newconfig/usr/lib/tztab.gz

You should now have a 'tztab' file that you can use on a 10.20 or 11.0 system.

Regards!

...JRF...
skt_skt
Honored Contributor

Re: How to handle the DST changes for 2008(HP-UX)

infact i could never download "Clays perl script".. may be a security config in our network...
Geoff Wild
Honored Contributor

Re: How to handle the DST changes for 2008(HP-UX)

Here's the dst.pl script - cut and paste:

Rgds...Geoff

-------------------------------

#!/usr/bin/perl -w

# Display DST transition times

use English;
use strict;
use Time::Local;
use POSIX qw(strftime);
use Getopt::Std;

use constant VRSN => '[1.04]';
# 1.0 09/14/1998 acs
# 1.01 01/03/2001 acs changed '%e' strftime format specifier to '%d' because
# stupid Windows does not understand real strftime
# 1.02 09/10/2003 acs minor change; subtract 1900 from $year command-line arg;
# the code works w/o this change but this is more proper
# 1.03 09/12/2003 acs added -n option to print only the next time change
# 1.04 10/01/2003 acs added -d option to output days (integer) until next time
# change

use constant SECONDS_PER_DAY => (24 * 60 * 60);
use constant FALSE => 0;
use constant TRUE => 1;

use constant TWO_DATES_MODE => 0;
use constant NEXT_MODE => 1;
use constant DAYS_LEFT_MODE => 2;

# ---------------------------------------------------------------

sub problem
{
my $msg = $_[0];
my $err = $_[1];

printf STDERR ("%s: %s (%d).\n",$PROGRAM_NAME,$msg,$err);
printf STDERR ("\n");
return($err);
} # problem


sub usage
{
printf STDERR
("\nUsage: %s [-y year | -n | -d] [-e] [-u]\n\n",
$PROGRAM_NAME);
printf STDERR
(" -y year - determine time changes for year; by default, the current\n");
printf STDERR
(" year is used.\n");
printf STDERR
(" -n - display only the next time change.\n");
printf STDERR
(" -d - display remaining days until next time change.\n");
printf STDERR
(" -u - print this usage message on stderr and exit.\n");
printf STDERR
(" -e - print the epoch seconds rather than the formatted times\n");
printf STDERR
(" if used with -d, display integer rather than fractional\n");
printf STDERR
(" days remaining until next time change.\n\n");
printf STDERR
("If successful, %s returns a zero result and writes two lines on\n",
$PROGRAM_NAME);
printf STDERR
("stdout of this form:\n");
printf STDERR
(" Sun Apr 5 01:59:59 CST 1998 --> Sun Apr 5 03:00:00 CDT 1998\n");
printf STDERR
(" Sun Oct 25 01:59:59 CDT 1998 --> Sun Oct 25 01:00:00 CST 1998\n");
printf STDERR
(" OR (if using -e option)\n");
printf STDERR
(" 891763199 --> 891763200\n");
printf STDERR
(" 909298799 --> 909298800\n\n");
printf STDERR
("These indicate the time displayed at the transition time and that\n");
printf STDERR
("displayed 1 second later.\n\n");
printf STDERR
("A non-zero result is returned if no TZ is known or no time transition\n");
printf STDERR
("occurs.\n\n");
printf STDERR
("Vrsn %s\n",VRSN);
return(1);
} # usage


sub find_dst # returns the last epoch second $target_isdst is in effect
{
use integer;

my $lo = $_[0];
my $max_hi = $_[1];
my $initial_interval = $_[2];
my $target_isdst = $_[3];
my ($begin_seconds,$next_seconds) = (-1,-1);
my $isdst = FALSE;

# advance by one interval until DST changes
my $hi = $lo;
my $fnd = FALSE;
my $hi_knt = 0;
while (!($fnd) && ($hi <= $max_hi) && ($hi_knt < 2))
{
$isdst = (localtime($hi))[8];
if ($isdst != $target_isdst)
{
$fnd = TRUE;
}
else
{
$lo = $hi;
$hi += $initial_interval;
if ($hi > $max_hi)
{
$hi = $max_hi;
++$hi_knt;
}
}
}
if ($fnd) # now start looking within $interval
{
my $go_down = TRUE;
my $tmp_seconds = $hi;
my $interval = ($hi - $lo) / 2;
while ($interval > 0)
{
if ($go_down)
{
$tmp_seconds = $hi - $interval;
$isdst = (localtime($tmp_seconds))[8];
if ($isdst == $target_isdst)
{
$go_down = FALSE;
$lo = $tmp_seconds;
}
else
{
$hi = $tmp_seconds;
}
}
else
{
$tmp_seconds = $lo + $interval;
$isdst = (localtime($tmp_seconds))[8];
if ($isdst != $target_isdst)
{
$go_down = TRUE;
$hi = $tmp_seconds;
}
else
{
$lo = $tmp_seconds;
}
}
$interval = ($hi - $lo) / 2;
}
if (((localtime($tmp_seconds))[8]) !=
((localtime($tmp_seconds + 1))[8]))
{
$begin_seconds = $tmp_seconds;
$next_seconds = $tmp_seconds + 1;
}
else
{
$begin_seconds = $tmp_seconds - 1;
$next_seconds = $tmp_seconds;
}
}
return($begin_seconds,$next_seconds);
} # find_dst

my $year = -1;
my $cc = 0;
my $do_format = TRUE;
my $yr_arg_knt = 0;
my $mode = TWO_DATES_MODE;
my $now = 0;

our ($opt_y,$opt_n,$opt_d,$opt_u,$opt_e);

if (!getopts('y:ndue'))
{
$cc = 252;
usage();
exit($cc);
}
if (defined($opt_y))
{
$year = $opt_y - 1900;
++$yr_arg_knt;
}
if (defined($opt_n))
{
$mode = NEXT_MODE;
++$yr_arg_knt;
}
if (defined($opt_d))
{
$mode = DAYS_LEFT_MODE;
++$yr_arg_knt;
}
if (defined($opt_e))
{
$do_format = FALSE;
}
if (defined($opt_u))
{
$cc = 251;
usage();
exit($cc);
}
if ($yr_arg_knt > 1 && $cc == 0)
{
$cc = 255;
problem("Only one -n or -y argument allowed",$cc);
}
if ($year <= 0)
{
$now = time();
$year = (localtime($now))[5];
}
if ($cc != 0)
{
exit($cc);
}
$cc = 2;

if (($mode == NEXT_MODE) || ($mode == DAYS_LEFT_MODE))
{
my $isdst_now = (localtime($now))[8];
my $seconds_Dec31 = timelocal(59,59,23,31,11,$year + 1);
my ($start1,$start2) = find_dst($now,$seconds_Dec31,
SECONDS_PER_DAY,$isdst_now);
if ($start1 > 0)
{
if ($mode == NEXT_MODE)
{
if ($do_format)
{
print strftime("%a %b %d %H:%M:%S %Z %Y",localtime($start1)),
" --> ",
strftime("%a %b %d %H:%M:%S %Z %Y",localtime($start2)),
"\n";
}
else
{
print $start1," --> ",$start2,"\n";
}
}
else
{
if ($do_format)
{
printf("%.4f\n",(($start2 - $now) / SECONDS_PER_DAY));
}
else
{
printf("%d\n",int(($start2 - $now) / SECONDS_PER_DAY));
}
}
$cc = 0;
}
}
else
{
my $seconds_Jan1 = timelocal(0,0,0,1,0,$year);
my $isdst_Jan1 = (localtime($seconds_Jan1))[8];
my $seconds_Dec31 = timelocal(59,59,23,31,11,$year);

my ($start1,$start2) = find_dst($seconds_Jan1,$seconds_Dec31,
SECONDS_PER_DAY,$isdst_Jan1);
if ($start1 > 0)
{
$cc = 1;
if ($do_format)
{
print strftime("%a %b %d %H:%M:%S %Z %Y",localtime($start1)),
" --> ",
strftime("%a %b %d %H:%M:%S %Z %Y",localtime($start2)),
"\n";
}
else
{
print $start1," --> ",$start2,"\n";
}
my ($end1,$end2) = find_dst($start2,$seconds_Dec31,
SECONDS_PER_DAY,!($isdst_Jan1));
if ($end1 > 0)
{
if ($do_format)
{
print strftime("%a %b %d %H:%M:%S %Z %Y",localtime($end1)),
" --> ",
strftime("%a %b %d %H:%M:%S %Z %Y",localtime($end2)),
"\n";
}
else
{
print $end1," --> ",$end2,"\n";
}
$cc = 0;
}
}
}
exit($cc);
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
James R. Ferguson
Acclaimed Contributor

Re: How to handle the DST changes for 2008(HP-UX)

Hi:

> infact i could never download "Clays perl script".. may be a security config in our network...

This one works for me:

http://forums12.itrc.hp.com/service/forums/getattachment.do?attachmentId=286290&ext=.pl

Regards!

...JRF...
skt_skt
Honored Contributor

Re: How to handle the DST changes for 2008(HP-UX)

How to identify version of the tzupdater from the servers?
skt_skt
Honored Contributor

Re: How to handle the DST changes for 2008(HP-UX)

Got it.


[kumarts@/home/kumarts] #/sa_lgd6_d/orabin/9.2.0.6.64/jdk/bin/java -jar

/home/kumars9/JAVA_DST/tzupdater.jar -V
tzupdater version 1.0.0-b03
JRE time zone data version: tzdata2006p
Embedded time zone data version: tzdata2006p