1745871 Members
4178 Online
108723 Solutions
New Discussion юеВ

Time Zone Setup

 
Hakki Aydin Ucar
Honored Contributor

Time Zone Setup

Based on Turkish Council of Ministers decision, made on Sep 7th 2016, Turkey will stay permanently on DST, i. e. UTC+3.

in HP-UX 11iv1 systems I still support during DST change we used to NTP servers.

But I am not sure if we have to change in TZ setup OR does HP have any solution / patch / recommendadtion for this ?

6 REPLIES 6
Bill Hassell
Honored Contributor

Re: Time Zone Setup

Changing the timezone rule is easy in HP-UX. There is a single file: /usr/lib/tztab with as many timezones as HPE can track. Timezones have little to do with actual time based on the earth's rotation -- they are all political, and therfore subject to change. However, you can adjust the rules in the tztab file. Indeed, you can create your own personal timezone. See the man pages for tztab and environ where you can specify a customized TZ value at any time. As with many flavors of Un*x, there is only one time kept in the OS: UTC, aka Zulu. Then all date/time tools use the current value of $TZ to translate the time. This is particularly use for systems that are accessed from different timezone areas. Just set TZ when you login for your local value. Now commands like ls -l will show the timestamp in your local time.

The most recent patch for the tztab file is from 2014 so you'll need to edit tztab for all your systems. I assume that "stay permanently on DST" means that there will be no adjustment during the year. So your local timezone for HP-UX would then be a single offset from UTC. Just add a new line under the TZ value you are currently using that specifies the beginning of the new rules and just remove the DST value.



Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: Time Zone setup Turkey

> does HPE have any solution / patch / recommendation for this?

 

Have you reported this to HPE yet?

 

>The most recent patch for the tztab file is from 2014 so you'll need to edit tztab

 

One drawback of doing this will occur the next time there is a TZ patch.  Last I'd heard was that any changes in tztab will cause the patch to refuse to change things.

 

>There is a single file: /usr/lib/tztab

 

I thought Java had its own file too.

Hakki Aydin Ucar
Honored Contributor

Re: Time Zone setup Turkey

> Have you reported this to HPE yet?

Yes , Turkey HPE said a patch will be prepared but they are not sure if completes before the day of DST back.

> One drawback of doing this will occur the next time there is a TZ patch.  Last I'd heard was that any changes in tztab will cause the patch to refuse to change things.

HPE advised a workaround like this , but there is a reboot at the end of this ?

# vi /etc/TIMEZONE

TZ=TRT-3

export TZ

 # reboot

Bill Hassell
Honored Contributor

Re: Time Zone setup Turkey

The TST-3 setting in /etc/TIMEZONE takes effect for each new login. What does the TIMEZONE file have in it now? Have you manually changed the time since the decision? If the offset is currently -3, then no reboot will be needed immediately. There are also two kernel parameters for setting the timezone values: timezone and dst. These are used when the system boots and older programs that do not set the TZ variable when they start will use these kernel values for their timezone. If they have never been changed, they are probably set to 420 and 1, the default for an HP-UX install.

So after you change /etc/TIMEZONE, you'll need to use kmtune to change the kernel settings. The dst vaue should be set to 0 and the timezone value should be set to -180 (minutes east of UTC). Then schedule a reboot.



Bill Hassell, sysadmin
Hakki Aydin Ucar
Honored Contributor

Re: Time Zone setup Turkey

Current view of TIMEZONE file;


>What does the TIMEZONE file have in it now?

root# echo $TZ
EET-2EETDST


root# file /etc/TIMEZONE
/etc/TIMEZONE: commands text
root# cat /etc/TIMEZONE
TZ=EET-2EETDST
export TZ

>Have you manually changed the time since the decision?

No , I have not changed manually the time yet.

>they are probably set to 420 and 1

Yes

Bill Hassell
Honored Contributor

Re: Time Zone setup Turkey

So the current TZ value, EET-2EETDST, is currently equivalent to TST-3 so no reboot is needed. You can verify this by temporarily changing TZ and showing the current time like this:

# TZ=EET-2EETDST date
Wed Sep 28 18:20:23 EETDST 2016

# TZ=TST-3 date
Wed Sep 28 18:20:24 EETDST 2016

The current kernel values (420 and 1 for timezone and dst) can be left as is since they have not caused any problems. The kernel values are use whenever the variable TZ is not set, sort of a fall back setting.

You can change /etc/TIMEZONE to:

TZ=TST-3
export TZ

and there will be no change when the old switch to standard time occurs with TZ=EET-2EETDST

 



Bill Hassell, sysadmin