DST change on Compaq Tru64


 
Thread Tools Search this Thread
Operating Systems HP-UX DST change on Compaq Tru64
# 1  
Old 10-17-2011
DST change on Compaq Tru64

Hello all,

I hope someone can help me.
We have Compaq Tru64 UNIX V5.1B (Rev. 2650).
By latest Belarus government act Europe/Minsk timezone was changed to
GMT+3 without DST (was GMT+2 with DST).
Please advice how to do changes on our machine.

Thank You in advance,
md1982
# 2  
Old 10-17-2011
I don`t know Tru64 at all. But i think you can use timezone just like you need if it exists in your system. Is there any that would fit?
I guess that you haven`t got support contract?
# 3  
Old 10-17-2011
There is always this you can attempt:
https://h20565.www2.hp.com/portal/si...tte.cachetoken
Quote:
CAUTION: This sample program has been tested using DEC C v 6.5 on OpenVMS IA64 v 8.2. However, there is no guarantee for its effectiveness because of the possibility of error in transmitting or implementing the program. It is meant to be used as a template for writing your own program, and may require modification for use on your system.

This program is supported on the following systems:

Product: DEC C, all versions

Operating System: OpenVMS, v 7.3-2 and Above, HP Tru64 UNIX, v 5.1B PK4, HP-UX B.11.23

Details

PROGRAM NOTES:

An alternative to setting (setenv ) the environment variable TZ is to define the symbol TZ prior to running the program.
See description of procedure tzset() in the DEC C Run-Time Library Reference Manual for OpenVMS Systems.
NOTE: Defining TZ also impacts localtime , mktime , strftime and wcsftime functions. See the description of procedure tzset() in the HP C Run-Time Library Reference Manual for OpenVMS Systems .

Click here to view the HP C Run-Time Library Reference Manual for OpenVMS Systems.

Compilation, link and run:

$ cc/prefix=all time
$ link time
$ run time

PROGRAM:

/*
COPYRIGHT ©) 1998-2005 BY
HEWLETT-PACKARD COMPANY
ALL RIGHTS RESERVED.

THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE INCLUSION
OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER COPIES
THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER
PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.

THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
SHOULD NOT BE CONSTRUED AS A COMMITMENT BY HEWLETT-PACKARD COMPANY.

HP ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY HP.

NO RESPONSIBILITY IS ASSUMED FOR THE USE OR RELIABILITY OF SOFTWARE
ON EQUIPMENT THAT IS NOT SUPPLIED BY HEWLETT-PACKARD COMPANY.

SUPPORT FOR THIS SOFTWARE IS NOT COVERED UNDER ANY HP SOFTWARE
PRODUCT SUPPORT CONTRACT, BUT MAY BE PROVIDED UNDER THE TERMS OF THE
CONSULTING AGREEMENT UNDER WHICH THIS SOFTWARE WAS DEVELOPED.
*/

/*
With HPUX 11i V2 (B.11.23)

$ ./time
tzname[0] = MET, tzname[1] = METDST, daylight = 1, timezone = -3600
Local time is Tue Feb 1 08:39:04 2005

tzname[0] = MET, tzname[1] = MET_DST, daylight = 1, timezone = -3600
In France the time is Tue Feb 1 08:39:04 2005

tzname[0] = STD, tzname[1] = , daylight = 0, timezone = 0
GMT Time is Tue Feb 1 07:39:04 2005

With Tru64 V5.1B and OpenVMS V7.3-2
$ run time
tzname[0] = MET, tzname[1] = MET DST, daylight = 1, timezone = -3600
Local time is Tue Feb 1 08:49:46 2005

tzname[0] = MET, tzname[1] = MET_DST, daylight = 1, timezone = -3600
In France the time is Tue Feb 1 08:49:46 2005

tzname[0] = GMT, tzname[1] = , daylight = 0, timezone = 0
GMT Time is Tue Feb 1 07:49:46 2005

*/

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

main(){
time_t local_time;
char *pdat;

/*
* Get Universal Time Coordinates time.
*/
local_time = time(NULL);

/*
* Get the Local Time Zone environment variable.
*/
tzset();
printf ("tzname[0] = %s, tzname[1] = %s, daylight = %d, timezone = %d\n",
tzname[0],tzname[1],daylight,timezone);
pdat = ctime(&local_time);
printf ("Local time is %s\n",pdat);
/*
* Set the Standard Time Zone to -1 hour from GMT.
* The Daylight Savings Time Zone saving to -2 hours from GMT.
* date when change from standard time to summer time occurs on:
* 3nd of March at 2AM
* date when change from summer time to standard time occurs on:
* 5th of September at 3AM.
*/
#if defined (__unix)
putenv("TZ=MET-1MET_DST-2,M3.4.0/2,M10.5.0/3");
#elif defined (__VMS)
setenv ("TZ","MET-1MET_DST-2,M3.4.0/2,M10.5.0/3",0);
#endif
/*
* Get the French Time Zone environment variable.
*/
tzset();
printf ("tzname[0] = %s, tzname[1] = %s, daylight = %d, timezone = %d\n",
tzname[0],tzname[1],daylight,timezone);
pdat = ctime(&local_time);
printf ("In France the time is %s\n",pdat);
#if defined (__VMS)
unsetenv("TZ");
#endif
/*
* Reset TZ environment variable to GMT time.
*/
#if defined (__unix)
putenv ("TZ=GMT0");
#elif defined (__VMS)
setenv ("TZ","GMT0",0);
#endif
/*
* Get the GMT Zone environment variable.
*/
tzset();
printf ("tzname[0] = %s, tzname[1] = %s, daylight = %d, timezone = %d\n",
tzname[0],tzname[1],daylight,timezone);
pdat = ctime(&local_time);
printf ("GMT Time is %s\n",pdat);
#if defined (__VMS)
unsetenv("TZ");
#endif
}
# 4  
Old 10-18-2011
Bug

Hi,

I would like to change TZ to one that has the same rules as new one for Belarus, and that is Asia/Qatar.
Can You point me how to do that, just to do:
Code:
# ln -sf /etc/zoneinfo/Asia/Qatar /etc/zoneinfo/localtime

Is it required restart of server?
Will it have permanently effect, I mean will not change back to previous values?

Tnx,
md1982

Last edited by md1982; 10-18-2011 at 09:24 AM..
# 5  
Old 10-18-2011
look at the zic(8) man page to change this (see /etc/zoneinfo/timezones too) the correct way (I think an example is given). And make sure you don't have a TZ environment variable defined. I can help much for its 8 years since last time I saw a tru64...(I may still have mans at home but its asking for digging...)
# 6  
Old 10-18-2011
First tnx for fast replay.
I have few more questions, first is how can I check if TZ environment variable is defined or not, and why is important that is not defined.

I have found this in man pages
"Setting Time Zone Information
Code:
  The /etc/zoneinfo/localtime link can be changed by the system administrator
  to any file in the /etc/zoneinfo directory.

  For example, the following command changes the local time zone to be con-
  sistent with the city of New York on the American continent:

       # ln -sf /etc/zoneinfo/America/New_York /etc/zoneinfo/localtime"

That is why I have asked is that correct?


But in suggested from you man zic there is other example so Im not sure:
EXAMPLES
Code:
  The following examples show how you use the time zone commands and data-
  bases.  You must be logged in as superuser (root) to use the following com-
  mands:

   1.  Use a procedure similar to the following if a system is relocated to a
       new timezone. This example uses Australian time zones and shows what
       you need to do when relocating a host system from from Brisbane
       (Queensland) to Sydney (New South Wales):

        a.  Verify the value of the link file /etc/zoneinfo/localtime as fol-
            lows:
                 # ls -l /etc/zoneinfo/localtime
                 lrwxrwxrwx   1 root  system   18 Mar 19 17:05 localtime -> \
                 ./Australia/Queensland

        b.  If necessary, use the zdump command to verify transitions in the
            target time zone as follows:
                 #zdump -c 2001 -v Australia/NSW
                 Australia/NSW  Fri Dec 13 20:45:52 1901 GMT = Fri Dec 13 15:45:52 1901 EST \
                 isdst=0 gmtoff=-18000
                 Australia/NSW  Sat Dec 14 20:45:52 1901 GMT = Sat Dec 14 15:45:52 1901 EST  \
                 isdst=0 gmtoff=-18000
                 Australia/NSW  Sun Mar 31 06:59:59 1918 GMT = Sun Mar 31 01:59:59 1918 EST  \
                 isdst=0 gmtoff=-18000
                 Australia/NSW  Sun Mar 31 07:00:00 1918 GMT = Sun Mar 31 03:00:00 1918 EWT  \
                 isdst=1 gmtoff=-14400
                 Australia/NSW  Sun Oct 27 05:59:59 1918 GMT = Sun Oct 27 01:59:59 1918 EWT  \
                 isdst=1 gmtoff=-14400
                 .
                 .
                 .
                 (output truncated)

        c.  Delete the /etc/zoneinfo/localtime link as follows:
                 # rm /etc/zoneinfo/localtime

        d.  Create a new /etc/zoneinfo/localtime link, specifying the target
            time zone as follows:
                 # ln -s /etc/zoneinfo/Australia/NSW localtime
                 #ls -l localtime
                 should now be: localtime -> ./Australia/NSW
                 check the transitions have changed using zdump

            Verify the new link as follows:
                 # ls -l /etc/zoneinfo/localtime
                 lrwxrwxrwx   1 root  system   18 Mar 19 17:05  /etc/zoneinfo/localtime ->  \
                 ./Australia/NSW

        e.  Repeat the zdump command in Step b to verify transitions in the
            target time zone.

   2.  The system time automatically changes for events such as Daylight Sav-
       ings Time. These time transitions are stored in the /etc/zoneinfo
       database. If necessary, you can verify and alter the rules that
       specify when a system will automatically alter its time. This example
       shows how you change the active /etc/zoneinfo file to include the
       changes to Daylight Savings Time. (Such a change was mandated for the
       2000 Olympics, moving the start date of Daylight Savings Time to
       August 27th in 2000, rather than the expected date of October 29th.)

       The example assumes that the system is located in Sydney, Australia:

        a.  Examine the active time zone setting as follows:
                 # ls -l /etc/zoneinfo/localtime
                 lrwxrwxrwx   root system  18 Mar 19 17:05 etc/zoneinfo/localtime ->  \
                 ./Australia/NSW

        b.  Use the zdump command to verify the time transitions for the
            active time zone.

            The zdump command prints transitions for every year since the
            beginning of rules for the active timezone. Use the more command
            or redirect (>) the output to a file so you can find the relevent
            transition. Use the -c option to specify the year at which the
            display output terminates. For example:
                 # zdump -c 2002 -v Australia/NSW
                 Australia/NSW  Sat Oct 30 15:59:59 1999 GMT = Sun Oct 31 01:59:59 1999 EST  \
                 isdst=0 gmtoff=36000
                 Australia/NSW  Sat Oct 30 16:00:00 1999 GMT = Sun Oct 31 03:00:00 1999 EST  \
                 isdst=1 gmtoff=39600
                 Australia/NSW  Sat Mar 25 15:59:59 2000 GMT = Sun Mar 26 02:59:59 2000 EST  \
                 isdst=1 gmtoff=39600
                 Australia/NSW  Sat Mar 25 16:00:00 2000 GMT = Sun Mar 26 02:00:00 2000 EST  \
                 isdst=0 gmtoff=36000
                 Australia/NSW  Sat Oct 28 15:59:59 2000 GMT = Sun Oct 29 01:59:59 2000 EST  \
                 isdst=0 gmtoff=36000
                 Australia/NSW  Sat Oct 28 16:00:00 2000 GMT = Sun Oct 29 03:00:00 2000 EST  \
                 isdst=1 gmtoff=39600

            Each pair of lines for the same date and time shows a time tran-
            sition.  On Sun Oct 29 2000 immediately after 01:59:59  the time
            changes to 03:00:00.  This transition changes the local time from
            Australian Eastern Standard Time (EST) to Daylight Savings Time
            (DST). The value of the isdst field changes as follows:

              +  0 - Not Daylight Savings Time

              +  1 - Daylight Savings Time
       The gmtoff field displays the offset from Greenwich Mean Time.

        c.  Display the contents of the /etc/zoneinfo database file for your
            locale to find the rules for the local zone. In this case, it is
            New South Wales:
                 # more /etc/zoneinfo/sources/australasia
                 .
                 .
                 # New South Wales
                 # Rule NAME  FROM  TO    TYPE  IN   ON      AT     SAVE  LETTER/S
                 Rule   AN    1971  1985   -    Oct  lastSun 2:00s  1:00    -
                 Rule   AN    1972  only   -    Feb  27      2:00s  0       -
                 Rule   AN    1973  1981   -    Mar  Sun>=1  2:00s  0       -
                 Rule   AN    1982  only   -    Apr  Sun>=1  2:00s  0       -
                 Rule   AN    1983  1985   -    Mar  Sun>=1  2:00s  0       -
                 Rule   AN    1986  1989   -    Mar  Sun>=15 2:00s  0       -
                 Rule   AN    1986  only   -    Oct  19      2:00s  1:00    -
                 Rule   AN    1987  1999   -    Oct  lastSun 2:00s  1:00    -
                 Rule   AN    1990  1995   -    Mar  Sun>=1  2:00s  0       -
                 Rule   AN    1996  max    -    Mar  lastSun 2:00s  0       -
                 # Zone NAME            GMTOFF  RULES   FORMAT  [UNTIL]
                 Zone Australia/Sydney   10:04:52 -      LMT     1895 Feb
                                         10:00   Aus     EST     1971
                                         10:00   AN      EST
                 Zone Australia/Broken_Hill 9:25:48 -    LMT     1895 Feb
                                         10:00   -       EST     1896 Aug 23
                                         9:00    -       CST     1899 May
                                         9:30    Aus     CST     1971
                                         9:30    AN      CST     2000
                                         9:30    AS      CST
                 <display truncated>

            From this display, you find the rules that apply to the current
            year. For the year 2000 the rules are as follows:
                 Rule  AN   1996  max   -   Mar  lastSun 2:00s 0   -

            The other rules either end on a past year or apply only for the
            year specified, as shown in the TO column.  The entry max in the
            TO column means that the rule applies from the year listed in the
            FROM column and for all future years.

        d.  Assume that on the last Sunday of October in 2000, you must
            change the time at 2:00 a.m. to be one hour more than the stan-
            dard time (EST).  On the last Sunday of March, you must change
            the time at 3:00 a.m. to be the same as EST, turning the clock
            back one hour when the previous rule was active.  (In this exam-
            ple, the 27th happened to be the last Sunday in August, making
            the transition change less complicated.) The new rule that you
            must add is as follows:
                 Rule  NAME  FROM  TO  TYPE IN    ON       AT    SAVE  LETTER/S
                 Rule      AN      2000  only    -         Aug   lastSun  2:00  1:00         -

        e.  To avoid corrupting the /etc/zoneinfo/sources/australasia data
            file, copy it to a backup revision as follows:
                 # cp  /etc/zoneinfo/sources/australasia   \
                 /etc/zoneinfo/sources/australasia.orig

            Then edit the file /etc/zoneinfo/sources/australasia with a text
            editor to add the following line:
                 Rule      AN      2000  only    -         Aug   lastSun  2:00  1:00         -

        f.  You can now use the zic command to update the database with the
            new transition rule as follows:
                 # /usr/sbin/zic /etc/zoneinfo/sources/australasia

        g.  Use the zdump command to verify the new transitions as follows:
                 # zdump -c 2002 -v Australia/NSW
                 .
                 .
                 .Australia/NSW  Sat Aug 26 15:59:59 2000 GMT = Sun Aug 27 01:59:59 2000  \
                 EST isdst=0 gmtoff=36000

            This truncated output indicates that the transition to Daylight
            Savings Time moved from October 29 to August 27, as required.


Last edited by vbe; 10-18-2011 at 06:04 AM.. Reason: code tags
# 7  
Old 10-18-2011
Code:
echo $TZ

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Change Time Zone to UTC without DST

Hello AIX friends, We have timezone settings on our AIX 6.1 boxes set to Europe/London. How can I change it to UTC timezone with Daylight saving disabled. After running "smit chtz_user" I don't see UTC option in the listing. Please advise. TIA (3 Replies)
Discussion started by: prvnrk
3 Replies

2. AIX

Bug in AIX 6.1/7.1 Time Zone DST Change -again

Hi Everyone Just wanted to share with you that IBM AIX is having again problem with Summer Time Shift.. IBM Possible Action Required: System time may not change properly at DST start/end dates on AIX 7.1 and AIX 6.1 - United States For me it means some additional overtimes in the... (0 Replies)
Discussion started by: gito
0 Replies

3. Linux

DST Time Change for positive timezones not working

I was doing timezone and DST testing which is required for some of my products Here is the strange behaviour i observed First i did set the timezone to PST 2010 (which is less than GMT basically negative timezone) zdump -v /etc/localtime |grep 2010 /etc/localtime Sun Mar 14 09:59:59... (0 Replies)
Discussion started by: ravindra1103
0 Replies

4. Linux

OS for Compaq Presario 1685

Hi, Trying to install a small OS to run this old laptop. Compaq Presario 1685, circa '98 Processor: AMD K6-2 380 MHz Data Bus Speed: 66 MHz Ram Installed 32 MB moduled Hard Drive: 4.3 GB DVD-ROM Burned in a CD “PUPPY-4.3beta1-k2.6.25.16-v423-SCSI”, tried to boot with it several times BUT... (7 Replies)
Discussion started by: nichos
7 Replies

5. Shell Programming and Scripting

DST Change For Australia

Hello , We are investigating an issue from a customer from Western Australia related to DST change on 25 th March. The customer in Australia has the below settings for Time Zone. The System is Solaris 9. TZ=Australia/NSW CMASK=022 We are trying to reproduce the problem in our local... (1 Reply)
Discussion started by: Mohammed
1 Replies

6. UNIX for Dummies Questions & Answers

Help In Compaq Tru64 UNix

Hi, I am new to UNIX. I need help in working with Compaq-UX TRU64 OS. How It work FTP Server? ANd MAil Server? and I have apach pprogram project and it work as HTTP Server. Also I need how can setup a new version of progrm on UNix like mozilla and adobe reader etc........... Thank... (3 Replies)
Discussion started by: svuad
3 Replies

7. SCO

compaq smart array 532

Trying to install Sco openserver on HP Proliant with this scsi controller but no scsi devices detected. Boot controller is set as the smart array 532 but SCSI diags do not detect any SCSI boot devices during boot sequence Any help appreciated (2 Replies)
Discussion started by: farmacy
2 Replies

8. UNIX for Dummies Questions & Answers

tru64 ip change

I'm trying to change the IP address of a Tru64 v4.0e box. The ifconfig command is not working. I am using the following format (which does not return an error): ifconfig tu1 xxx.xxx.xxx.xxx netmask 255.255.255.0 The xxx* indicates the new IP. After entering that command, an ifconfig -a command... (1 Reply)
Discussion started by: bscottiii
1 Replies

9. Filesystems, Disks and Memory

Compaq Scsi

Howto make Debian GNU/Linux install boot on a Compaq DeskPro XL 590 with Compaq SCSI diskdrive? The problem is that Compaq's Scsi controller sems to be odd. help please :) (0 Replies)
Discussion started by: Esaia
0 Replies

10. Programming

HPUX and Compaq problem-urgent

Hi All Following is the lines of code which simply makes a structure of 1 bit member and 7 bit is unused.Then the structure is initialised with char pointer.The output on HPUX(BIG Endian) and Compaq(Little Endian) are different.On HPUX it gives zero and Compaq it gives 1. I never thought that the... (7 Replies)
Discussion started by: Shobhit
7 Replies
Login or Register to Ask a Question

Featured Tech Videos