Problem of Hongkong timezone on Solaris 2.4

Problem of Hongkong timezone on Solaris 2.4

Post by Mr Benjamin PunTak » Fri, 28 Jul 1995 04:00:00



Hi,

We try to upgrade our OS from Solaris 2.3 to 2.4 but we find
the Hongkong time zone inconsistent between two releases.

We use Rouge Wave Tools.h++ (a C++ class library) to develop
our application.  And we find our application on Solaris 2.4i
goes one hour faster than the UNIX system time.  We reported
our problem to Rouge Wave Technical Support and they said the
problem is due to inconsistency in the value of the daylight
variable (declared in time.h) between Solaris 2.3 and 2.4
for the Hongkong timezone.

Rogue Wave adds the one hour offset of daylight saving
according to whether the daylight variable is set or not.
However, the behavior of that variable is different on
Solaris 2.3 and 2.4.

We ran the following program on 2.3 and 2.4 respectively
and got the results below.

-- Program Listing --

#include <stdio.h>
#include <time.h>

main()
{
        time_t t = time(NULL);

        printf("current time = %s", ctime(&t));
        printf("daylight = %d\n", daylight);

Quote:}

-- Run on Solaris 2.3 --
$ uname -a
SunOS europa 5.3 Generic sun4c sparc
$ echo $TZ
Hongkong
$ tz
current time = Thu Jul 27 11:47:57 1995
daylight = 0
$ export TZ=HKT-8
$ tz
current time = Thu Jul 27 11:48:15 1995
daylight = 0
$
----

-- Run on Solaris 2.4 --
$ uname -a
SunOS mao 5.4 generic sun4c sparc
$ echo $TZ
Hongkong
$ tz
current time = Thu Jul 27 11:46:02 1995
daylight = 1
$ export TZ=HKT-8
$ tz
current time = Thu Jul 27 11:46:14 1995
daylight = 0
$
----

You can see if the timezone is set to Hongkong.  The daylight
variable is set to 1 on Solaris 2.4 but 0 on Solaris 2.3 where
we haven't that time problem.  Since the timezone is set by the
system after we chose Hongkong as our timezone during the OS
installation, we prefer not to modify our timezone of get rid of
that problem.  

Do anyone of you see this problem?  I wonder if the inconsistency
of daylight value for the Hongkong timezone between 2.3 and 2.4
is a bug.  Is it a patch there?

        --Thomas

 
 
 

Problem of Hongkong timezone on Solaris 2.4

Post by Paul Egge » Sat, 29 Jul 1995 04:00:00



        #include <stdio.h>
        #include <time.h>
        main()
        {
                time_t t = time(NULL);
                printf("current time = %s", ctime(&t));
                printf("daylight = %d\n", daylight);
        }
        $ echo $TZ
        Hongkong
        $ tz
        current time = Thu Jul 27 11:46:02 1995
        daylight = 1

That's not a bug.  The documentation says that `daylight' is 1 if an
alternate timezone exists; this is independent of whether daylight
savings time is currently in effect.  In the case of Hong Kong, an
alternate time zone exists, even though it hasn't been used since 1980.

The meaning of `daylight' in Solaris 2.4 is standard practice;
e.g. see <ftp://elsie.nci.nih.gov/pub/tz*>.

Quote:> Rogue Wave adds the one hour offset of daylight saving
> according to whether the daylight variable is set or not.

That's a bug in Rogue Wave.  There's really not much reason to look at
the `daylight' variable, except for sizing an array of time zone names
to contain either 1 or 2 names.  To determine whether daylight savings
time is in effect, one should invoke localtime and look at tm_isdst.

Quote:> Is it a patch there?

One way that might work around the problem is to edit
/usr/share/lib/zoneinfo/asia as follows:

# Zone  NAME            GMTOFF  RULES   FORMAT  [UNTIL]
Zone    Asia/Hong_Kong  8:00    -       HKT
# Here are the correct values, but they tickle a bug in Rogue Wave.
#Zone   Asia/Hong_Kong  7:36:36 -       LMT     1904 Oct 30
#                       8:00    HK      HK%sT

and then use `zic' to install this into your time zone tables.
This will cause your software to be up to an hour off for some
timestamps before 1981, but that is is probably no big deal for you.

 
 
 

1. Solaris 2.4 Timezone for Istanbul

Greetings,

I am trying to get a few SPARC's up in Istanbul and am having trouble
getting the timezone information right.  I set it to Turkey and GMT+2
and both ways seem to set the TZ environment variable but only give me
GMT time - I need GMT+2.

I can deal with just setting the time ahead two hours, but I would much
rather do it right.

Thanks,
Kevin Quinn

PS - Randy says, "Have a Kabob"

2. linux + @home cable modem

3. reset timezone on Solaris 2.4

4. Appletalk problems with CAP under 2.5.1

5. Wu-ftpd 2.4 under Solaris 2.4

6. PPP: What's The Best Way...

7. PROBLEM: my Aviator Webgear 2.4 doesn't work with kernel version 2.4.x

8. Help compiling kernel

9. Timezone problem - Solaris ignores /usr/share/lib/zoneinfo

10. problem setting timezone on SS-10 running Solaris 2.5.1

11. Solaris x86 2.4 && firewall sendmail problem

12. SLEEPTIME problem on Solaris 2.4

13. HP-4M Solaris 2.4 Printing Problems