Operating System - HP-UX
1825063 Members
4983 Online
109679 Solutions
New Discussion юеВ

Re: Regarding Daylight Saving

 
SOLVED
Go to solution
vind123
Regular Advisor

Regarding Daylight Saving

(wao)-> date
Thu Aug 3 09:25:30 CST 2006
(wao)-> echo $TZ
CST0
(wao)-> cat /etc/TIMEZONE
TZ=CST0
export TZ
(wao)-> date
Thu Aug 3 09:30:53 CST 2006
(wao)-> date -u
Thu Aug 3 09:30:56 UTC 2006

1. Since daylight saving time is going to be changed next year i was thinking of changing the /usr/lib/tztab file to correct this one. But i observed when i do a date -u i am getting the central time. Is the central time is set instead of GMT Time by sysadmin? My prior understanding is all HP-UX os runs under GMT time and when i do a date -u i should get GMT Time.

2. If the Sysadmin had changed System's (GMT Time) to Central time how do the time changes during daylight time period i.e when i do a date after April and before october what will happen? TZ is set as CST0.


3. What do i need to do for daylight saving changes if this is the scenario?
71 REPLIES 71
Patrick Wallek
Honored Contributor

Re: Regarding Daylight Saving

If you are expecting Central Time zone in the USA, then your TZ should be CST6CDT. You CST0, is basically telling it to use UTC. The '0' there indicates a zero offset from UTC.

According to this, you are not doing anything for DST right now.

So for anything DST, you need to set your timezone to be correct.

If you search HP's patch database you will see patches available for the changes to DST next year. These essentially provide you with a new /etc/tztab file.
A. Clay Stephenson
Acclaimed Contributor

Re: Regarding Daylight Saving

Your sysadmin has changed the default TZ setting to a non-standard TZ but that is okay. Now, I assume that your time as reported above is accurate; if so, then all is well and any processes started by you will be under your TZ. Bear in mind that users from all over the planet could be logged in, each with his own TZ defined and exported and all of that works and date reports sensible times BUT this does assume that date -u does actually report correct UTC values if not then you have a mess.

You can even makeup your own TZ and put entries in /usr/lib/tztab to handle the daylight saving time changes peculiar to your environment.

In your case because the offset for CST and UTC is 0, both date commands report the same time.

By the way, there os a patch out to update the tztabs but it is a very simple thing to do manually.
If it ain't broke, I can fix that.
vind123
Regular Advisor

Re: Regarding Daylight Saving

date -u reports GMT Time. Will the system admin be able to change this system time to CST time? How do they do it?
Bill Hassell
Honored Contributor

Re: Regarding Daylight Saving

CST0 is not Centrl time in the US. According to the man page for environ, the first 3 or more characters are just an arbitrary ID. The number 0 means that your system is reporting time the same as GMT0 or as you have already seen, date -u reports the same time.

So two things have gone wrong:

1. The value of TZ (for Central timezone in the US) should have been CST6CDT (and you'll see this in the tztab file).

2. The sysadmin set the date with CST0 as the current timezone. The date command translated CST0 as the same as GMT0 and therefore your HP-UX time (which is always Zulu , GMT or UTC) is completely wrong. You'll need to set TZ=CST6CDT in /etc/TIMEZONE then login as root and set the time correctly (date will now show the time off by 6 hours). When you set the time with TZ=CST6CDT then the HP-UX internal time will be set 6 hours ahead (which is GMT) and your local time will be correct.


Bill Hassell, sysadmin
vind123
Regular Advisor

Re: Regarding Daylight Saving

1. The Sysadmin had changed TZ to CST0. But when i do a date -u i am able to see the output as central time and not GMT Time. Can the Sysadmin change the GMT time to Central time?

2. If the date -u and date shows central time and TZ is CST0, during daylight saving i.e from april to October , does the time will remain the same or different when i date?
Bill Hassell
Honored Contributor

Re: Regarding Daylight Saving

> 1. The Sysadmin had changed TZ to CST0. But when i do a date -u i am able to see the output as central time and not GMT Time. Can the Sysadmin change the GMT time to Central time?

As mentioned above, CST0 is GMT. The man page for environ explains this. When the stsadmin changed TZ to CST0 for all users including root, everyone will see the time as GMT. Then the sysadmin changed the current time to match your local time. So, date -u and date produce the exact same value as expected. The sysadmin must change TZ to CST6CDT or your time will never change during Daylight Saving and all timestamps for your files and databases will be off by 6 hours.


> 2. If the date -u and date shows central time and TZ is CST0, during daylight saving i.e from april to October , does the time will remain the same or different when i date?

Again, as documented:

man environ
man tztab

there is NO Daylight Saving change for CST0 or GMT0 or any TZ value that does not have a Daylight Saving tag such as the CDT in CST6CDT.

To fix your system, shutdown all applications or reboot into single user mode. Then edit the file /etc/TIMEZONE to read:

TZ=CST6CDT
export TZ

Then type the command:

. /etc/TIMEZONE

and now change the date to your current Central timezone. The date command will read what you typed in, then translate that time +6 hours to GMT and set the HP-UX internal time. The date command will report the correct time and date -u will report GMT correctly too.

The TZ value is crucial to proper time on your system. The CST6CDT value will adjust correctly for Daylight Saving based on the rules in tztab. As far as next year's change, you need to change tztab to match the new rules. The patches are:

11.23 - PHCO_34669
11.11 - PHCO_34668
11.00 - PHCO_27528

There are no patches for unsupported versions of HP-UX such as 10.20 but the rules are the same for all versions of HP-UX so you can download any of the above patches and use tar to pull out a copy of tztab (which is in gzip format - unpack with gunzip). The README file for the patch describes the changes for Indiana but you can grep for the 2006 and 2007 changes in the new tztab like this:

cd PHCO_34669/UX-CORE/usr/newconfig/usr/lib
grep -e 2006 -e 2007 tztab

#@(#) tztab $Date: 2006/03/21 21:09:54 $Revision: r11.23/2 PATCH_11.23 (PHCO_34669)
# due to go into effect in 2007. Modifications is done
0 3 1-7 4 1987-2006 0 PDT7
0 3 8-14 3 2007-2038 0 PDT7
0 1 25-31 10 1975-2006 0 PST8
0 1 1-7 11 2007-2038 0 PST8
0 3 1-7 4 1987-2006 0 EDT4
0 3 8-14 3 2007-2038 0 EDT4
0 1 25-31 10 1975-2006 0 EST5
0 1 1-7 11 2007-2038 0 EST5
0 3 1-7 4 1987-2006 0 CDT5
0 3 8-14 3 2007-2038 0 CDT5
0 1 25-31 10 1975-2006 0 CST6
0 1 1-7 11 2007-2038 0 CST6
0 3 1-7 4 1987-2006 0 MDT6
0 3 8-14 3 2007-2038 0 MDT6
0 1 25-31 10 1975-2006 0 MST7
0 1 1-7 11 2007-2038 0 MST7
# from 2006 onwards. Indiana will have two
0 3 1-7 4 2006 0 EDT#Indiana4
0 3 8-14 3 2007-2038 0 EDT#Indiana4
0 1 25-31 10 2006 0 EST5
0 1 1-7 11 2007-2038 0 EST5
0 3 1-7 4 2006 0 CDT#Indiana5
0 3 8-14 3 2007-2038 0 CDT#Indiana5
0 1 25-31 10 2006 0 CST6
0 1 1-7 11 2007-2038 0 CST6
# For the commonwealth games to be held in Melbourne Australia in 2006
# The entries are changed only for 2006 : just move the end of daylight
# savings ahead one week to the first sunday, April 2006. From 2007
0 2 1-7 4 2006 0 CST-9:30
0 2 25-31 3 2007-2038 0 CST-9:30
0 2 1-7 4 2006 0 EST-10
0 2 25-31 3 2007-2038 0 EST-10
0 2 1-7 4 2006 0 EST-10
0 2 25-31 3 2007-2038 0 EST-10
0 2 1-7 4 2006 0 EST-10
0 2 25-31 3 2007-2038 0 EST-10
0 2 1-7 4 2006 0 EST-10
0 2 25-31 3 2007-2038 0 EST-10

Since these changes are simply defining the new timezone rules, you can easily make the changes yourself (although the patch is easier).

To show how TZ affects the display (and setting) of the current time:

date
TZ=EST5EDT date
TZ=MST7MDT date
TZ=PST8PDT date
TZ=BILLH2 date

The last one is an example of creating a custom that specifies the time somewhere in the middle of the Atlantic Ocean. The important part of your original question is about correct Daylight Saving rules for next year. The above patch will make the TZ=CST6CDT value for TZ work correctly.


Bill Hassell, sysadmin
vind123
Regular Advisor

Re: Regarding Daylight Saving

11.23 - PHCO_34669
11.11 - PHCO_34668
11.00 - PHCO_27528

In which URL i need to download this patch. Also how do i give the tar command since i am not familiar with it
Jaime Bolanos Rojas.
Honored Contributor

Re: Regarding Daylight Saving

Vind123,

This the link that you use to find the patches
http://www2.itrc.hp.com/service/patch/mainPage.do

It's located on this same site itrc.hp.com, just click on Maintenance and support for hp products and then patch database link.

To untar a file just use

tar -xvf patch_name

Also when you download the patch, you will have a Readme file with in instruction on how to proceed with the installation.

Regards,

Jaime.
Work hard when the need comes out.
A. Clay Stephenson
Acclaimed Contributor

Re: Regarding Daylight Saving

It would really help if you explained the reason that TZ is set to "CST0". When I first saw this, I took it to mean that the sysadmin was saying "yes, I know the system is physically located in the Central (US) Time Zone but I am going to make the default time the same as UTC (offset 0)."
If it ain't broke, I can fix that.
vind123
Regular Advisor

Re: Regarding Daylight Saving

Apologies for the delay.

Clay,

Now the daylight saving time is going on (April to october). But our Unix system time is showing CST time not CDT time. When we do a date and date -u i am getting the CST time. I am assuming the sysadmin might have changed the time of the unix system from GMT to CST because of that date -u give CST time. So there might be no daylight savings in our system. Also dont know why TZ is set to CST0. So even if i change tztab file it is not going to make any difference. Pls correct me if i am wrong

Bill Hassell
Honored Contributor
Solution

Re: Regarding Daylight Saving

Your system time has been incorrectly setup. This was caused by using the wrong value for TZ when the time was set. As mentioned before, HP-UX always keeps time in GMT, but the system administrator must set TZ to match your local timezone, then set the time. The correct TZ value will then be translated into the correct GMT time. CST0 is very wrong. Yes, it tells the system how to translate the time but you can also set TZ=BILLH0 and get *exactly* the same results.

So your system has two very big mistakes:

TZ=CST0
time was set using TZ=CST0

Are you located in the Central timezone? If so, your system administrator must make the following two changes:

1. edit /etc/TZTAB to read:
TZ=CST6CDT
export TZ

2. type these two commands as root:
export TZ=CST6CDT
date 09071012

(where 09071012 is your current month-day-hour-minute). NOTE: if you hyave date-sensitive applications, your system administrator must stop them first, then make the change. Or the admin can reboot your system into single user mode and type the same commands, then change to the normal init state (like init 3).


Bill Hassell, sysadmin
vind123
Regular Advisor

Re: Regarding Daylight Saving

Bill,
Our unix systems are running under CST time(sys admin had changed the GMT time to CST Time). date -u and date both gives Central Standard time.If for any specific reason they want our software application running in UNIX systems to be in CST time then my assumption is TZ set to CST0 is correct. So if this is a valid reason, then throughout the year our unix systems will be running under CST time. Then adding a hour and subtraction an hour will not happen in our system during daylight period (april to oct) and our date command will never show CDT throughout the year. Pls correct me if i am wrong.
Bill Hassell
Honored Contributor

Re: Regarding Daylight Saving

Yes, your system is very much incorrect. Your HP-UX clock is set to local time, not GMT as it should be. There is nothing valid about CST0 -- it is EXACTLY the same value as GMT0 which is why date -u and date produce the same results (a big error). You will not find any entry in tztab for CST0. Note that CST0 does not produce an error message even though it is wrong. CST0 will *NEVER* follow daylight saving rules as stated in the man page for environ.

If you follow the two steps I mentioned above (edit /etc/TIMEZONE, and set the current time *with* TZ=CST6CDT) then your system will be correct, daylight saving time will start working and you'll have the correct time for date -u. If you don't feel comfortable making these two changes, just run the command:

/sbin/set_parms timezone

This is how the timezone is set when your system is first installed. In either case, the time will be set correctly, date -u will work and daylight saving will work. Otherwise, you'll have a mess in a few weeks when time switches and your system doesn't.


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: Regarding Daylight Saving

And based on your latest comment about not wanting daylight saving to be in effect, you can set your TZ to be CST6 rather than CST6CDT. I am confused because your original question was about proper handling of daylight saving. If you do not want daylight saving then use CDT6. And as mentioned before, you need to first set TZ=CDT6 *then* set the date+time. Note that if you set the time with CST6, be sure to use the correct time (not your local time for several weeks). Or better yet, set the GMT time using date -u

If all of this is confusing, it is because your system is setup in a very unstable way. Perhaps your sysadmin can explain why a non-standard TZ value is being used.


Bill Hassell, sysadmin
vind123
Regular Advisor

Re: Regarding Daylight Saving

Bill,

1. In case if the application running in our unix machine prefers to be in Central standard time and they had set it CST0, i can assume that there is no daylight change impact will be there in our machine. I think it would be better if i can update tztab file so that in future if they change TZ to be CST6CDT it will reflect the proper time. Hope i am correct?


2. Is Setting CST0 or CST6 are same if my system time (date -u) is in Central standard time? what it will make difference?
Bill Hassell
Honored Contributor

Re: Regarding Daylight Saving

> 1. In case if the application running in our unix machine prefers to be in Central standard time and they had set it CST0,

"they" set it wrong. The application is not running in Central time, it is running in UTC (GMT) time.

> i can assume that there is no daylight change impact will be there in our machine.

CST0 specifies *no* daylight saving time.

> I think it would be better if i can update tztab file so that in future if they change TZ to be CST6CDT it will reflect the proper time. Hope i am correct?

Yes, the tztab file should be updated. It will have *NO* effect on your system because there is no CST0 entry in tztab.


> 2. Is Setting CST0 or CST6 are same if my system time (date -u) is in Central standard time? what it will make difference?

No, you still are missing the conversion rule. You can set TZ=ABC0 or TZ=CST0 and the time will still be the same as date -u. Ther zero means "no offset from date -u time". CST6 simply says "show time 6 hours less than UTC (GMT)" But because your machine has the wrong date -u time, none of the timezone offsets are meaningful.


Bill Hassell, sysadmin
vind123
Regular Advisor

Re: Regarding Daylight Saving

Bill,
In your earlier chat you had told the below things

The patches are:
"
11.23 - PHCO_34669
11.11 - PHCO_34668
11.00 - PHCO_27528

There are no patches for unsupported versions of HP-UX such as 10.20 but the rules are the same for all versions of HP-UX so you can download any of the above patches and use tar to pull out a copy of tztab (which is in gzip format - unpack with gunzip).
"
I tried to download PHCO_27528 http://www2.itrc.hp.com/service/patch/mainPage.do and clicked on the
Maintenance and support for hp products and then patch database link. Hope it is a free download?



1. When i tried to search for this patch PHCO_27528 i got three options
s700_800 11.00 tztab(4) cumulative patch
PHCO_27528 (Specified)
posted: 2002/08/14
PHCO_27528 (Recommended)
posted: 2002/08/14
PHCO_34673 (Most Recent)
posted: 2006/03/29

Which one i should choose. I had chosen Recommended one.

2. When i click on PHCO_27528 i am getting the below info. It says about change in
Mexico DST. Is this patch is not for US Daylight change for 2007

PHCO_27528:
1. Tztab file requires to be updated due to change in
Mexico DST.


3. I tried to download the patch. There were two options. One is HTTP and another one is FTP. If i choose HTTP it displaying in Interexplorer. How do i continue after that. I tried FTP and it's saying "Windows cannot access this folder. Make sure you
typed the file name correctly and that you have permission to access the folder" How do i download the patch


Bill Hassell
Honored Contributor

Re: Regarding Daylight Saving

You have to download PHCO_34673 as the other patches do not have the 2007 changes.

Your Iexplorer is not configured quite right but I can't tell you how to fix it. I use Firefox and have no problems. What you can do is to RIGHT-CLICK on the FTP button and select "Save Link As..." at which point you will get a directory selection box so you can pick where to store the file. If that isn't working, you can use ftp to pull down the file:

0. cd 1. Run ftp from a Command (MSDOS) window
2. type: ftp ftp.itrc.hp.com
3. username: ftp password: ftp
4. type: cd hp-ux_patches/s700_800/11.X
5. type: binary
6: type: get PHCO_34673
7. type: bye

Now transfer this file to your HP-UX box. If you use ftp, always use the binary command before transferring.

On the HP-UX system, you must:

1. type: cd 2. type: sh PHCO_34673
3. Step 2 creates 2 additional files, a readme and the depot file.

Now because you are using an unsupported version of HP-UX, you CANNOT install this patch--the swinstall program will reject the patch as inappropriate for 10.20. So we are going to extract the tztab file:

1. cd
2. type: tar xvf PHCO_34673.depot PHCO_34673/UX-CORE/usr/lib/tztab
Now the above command has 4 parts:

tar
tvf
PHCO_34673.depot
PHCO_34673/UX-CORE/usr/lib/tztab

Be sure that there is at least one space between each part. When the command finishes (in a second or two), you will now have the file in your local directory. Do this to install the new tztab file:

mv PHCO_34673/UX-CORE/usr/lib/tztab /usr/lib/tztab

Then remove the temp directories:

rm -r PHCO_34673/UX-CORE/usr/lib

And you are done. To see that the changes were made in tztab, do this:

grep 2007 /usr/lib/tztab

Now you realize that this is all academic because your current timezone setting is incorrect and will never use anything in the tztab file, correct? If you need to put back the old tztab file, do this:

cp /usr/lib/tztab /usr/lib/tztab.new
cp /usr/newconfig/usr/lib/tztab /usr/lib/tztab


Bill Hassell, sysadmin
vind123
Regular Advisor

Re: Regarding Daylight Saving

Thanks a lot bill. will try out and get back to you.

"On the HP-UX system, you must:

1. type: cd 2. type: sh PHCO_34673
3. Step 2 creates 2 additional files, a readme and the depot file. "

When you give sh PHCO_34673 will it create the 2 additional file in the currentdirectory or install it somewhere?
Will it change something in HP-UX?

vind123
Regular Advisor

Re: Regarding Daylight Saving

Bill,
I tried to ftp the below way from my system and i am getting connection timeout message
C:\backed data\aravind data\Aravind\HP-UX Patch>ftp ftp.itrc.hp.com
Connected to ftp.itrc.hp.com.
220-
220-Welcome to the IT Resource Center ftp server
220-------------------------------------------------------
220-
220-You are user 32, and there is a limit of 800 simultaneous accesses.
220-
220-Log in as user "anonymous" (using your e-mail address as your password)
220-to retrieve available patches for HP-UX, MPE/iX, and other platforms.
220-
220-If you are a user of other HP ITRC services, log in with your
220-HP ITRC User ID and password to deposit or retrieve your files.
220-
220-If you have questions, send email to:
220-
220- support_feedback@europe-ffs.external.hp.com
220-
220 i3107ffs FTP server (HP ASL ftpd, version(400)) ready.
User (ftp.itrc.hp.com:(none)): ftp
331 Guest login ok, send your complete e-mail address as password.
Password:
230-The response 'ftp' is not valid
230-Next time please use your e-mail address as your password
230- for example: joe@59.145.136.1
230 Guest login ok, access restrictions apply.
ftp> cd hp-ux_patches/s700_800/11.x
550 hp-ux_patches/s700_800/11.x: No such file or directory.
ftp> cd hp-ux_patches/s700_800/11.X
250 CWD command successful.
ftp> binary
200 Type set to I.
ftp> get PHCO_34673
200 PORT command successful.
425 Can't build data connection: Connection timed out.
ftp> get PHCO_34673
200 PORT command successful.
425 Can't build data connection: Connection timed out.
ftp>
Bill Hassell
Honored Contributor

Re: Regarding Daylight Saving

The two additional files will be created in thye same directory. You have to tyalk to your network administrastor about your PC and ftp problems. The data connection error indicates that your firewall is likely blocking ftp service.


Bill Hassell, sysadmin
James R. Ferguson
Acclaimed Contributor

Re: Regarding Daylight Saving

Hi:

In lieu of using FTP to fetch your patches, you can download them from the Patch Database to your PC in HTML.

Once you have saved the patch (file) on your PC, FTP it in binary mode to your Unix server and install it.

Regards!

...JRF...
vind123
Regular Advisor

Re: Regarding Daylight Saving

Bill,
When i view the tztab file after tar i am getting unreadable characters

ll
total 244
-rw-r--r-- 1 scc scc 40960 Mar 27 08:16 PHCO_34673.depot
-rw-r--r-- 1 scc scc 10217 Mar 29 07:36 PHCO_34673.text
-rwxrwxrwx 1 scc scc 73621 Sep 20 05:36 PHCO_34673.txt

-> tar xvf PHCO_34673.depot PHCO_34673/UX-CORE/usr/lib/tztab
x PHCO_34673/UX-CORE/usr/lib/tztab, 3174 bytes, 7 tape blocks

->view tztab
"tztab" [Read only] [Incomplete last line] 18 lines, 3151 characters (22 nulls)
^_├в ┬╣^H^C├Г [[s├Г ├В┬╢^R~├Г ├В┬п├Г ├Г }Pf,^M)├Г┬л├Г┬к├В┬з├Г┬г$J'├Г ├в ├Г┬г)├в ┬в├Г ├Г┬▒^[$├Г ^V├В (RCRv├Г _├Г ]\^H├в ^BH├В┬╣├Г nr2├В ├В┬╢├Г┬б~X,>├В┬╗├в ┬╣^EtF├Г┬╛├Г >{O~├Г┬╣├В =├в ┬жY├Л ├Г ├в d├Г┬мu├Г┬╗]├В┬┐├Г┬л├В ├Г /├в ├Г┬┐i├В┬╡├Г ├Г ,├Г s^V├В┬▒}├Е┬б├Г┬м(^K├В┬│├Г┬е├Е┬б├в {^V├Г┬ж
├Г┬з6A├В l├В┬╖,├Г┬╜^K├Г ├В┬н├Г ├Г┬┤├В┬╛├Г┬г├Г ├В┬ж├Г }├Г #^W├В┬д7├Г┬и\├Г┬╕├Г┬░_├Г┬вO├Г ^W├В ├Е┬╛w1&^^├Г┬иGy├В┬з^G├Л ^^├Г┬й├Г┬╡;^W^^├в ┬вH├в ?├в ┬в^L$^B├Г ^HW├Г┬б{├Л ^L├Г * ^M]├В┬н"F├В┬жh^P├В┬г1├в ┬в├в ┬б[vn├Г┬╜J>├Г C^T>├В┬оs^R├Г ├В┬з0~├Г ├Г┬╕W0y├Е┬╜&├Г ?^E├Г┬│z├В┬г^Q├Г d
├Г┬╢├В┬╝├Г ├Г┬м├В┬╣4├Г┬╗├Г ├в ├В┬▒├Г┬╕9\├В┬о├Г L[├Г┬╜!^M├Г┬│0[├в `├В ├в
├Г┬│~├В ├Г ├В┬╜^OV├Г ├Г _}├В┬о^U├Г ├В┬╝[├в ┬м├Г ^S ^X├В ]^^U├В 5L|m├В┬╕^B├Г┬┤^L@├Г p^E
James R. Ferguson
Acclaimed Contributor

Re: Regarding Daylight Saving

Hi Vind:

The reason that your 'tztab' (from the depot) is unreadable is that it is in compressed format. Do:

# mv tztab tztab.gz
# gzip -d tztab.gz

You will now have an ASCII 'tztab' file.

Remember, you should use 'swinstall' to actually install the patch ('tztab') since by doing this you are recording in the Installed Product Database the installation. Thus, a subsequent 'swlist' will show the history.

Regards!

...JRF...