Operating System - HP-UX
1748171 Members
4174 Online
108758 Solutions
New Discussion юеВ

Re: How to change the time and time zone

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How to change the time and time zone

Hi All,

i want to change the time and time zone (CST).

My current setting:

# date
Tue Dec 1 09:29:23 NST 2009
14 REPLIES 14
James R. Ferguson
Acclaimed Contributor
Solution

Re: How to change the time and time zone

Hi:

You can use:

# /sbin/set_parms timezone

...to trigger an interactive reset.

Otherwise, change '/etc/TIMEZONE' and '/etc/default/tz' to reflect your correct zone.

Since a "timezone" is a +- offset from UTC (also known as GMT) and since UNIX handles time in epoch UTC seconds, do _not_ adjust your actual server time if it is already correct. You can verify it with:

# date -u

...and compare the value returned to an reliable external source. Of course you _should_ also be running NTP to keep your server's time synchronized.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: How to change the time and time zone

Shalom and good morning.

I would use set_parms timezone

In this case.

That utility must be run by root.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Rita C Workman
Honored Contributor

Re: How to change the time and time zone

I concur with the learned gentlemen who have answered already.

Just a word of caution. Remember, that if you change time settings you must be sure that you will not affect applications, if you are backing up in time.
Software, such as Oracle, are timestamped for transactions and would be adversely affected in the event of a time backup. Going forward - no big deal.

Kindest regards,
Rita
Dennis Handly
Acclaimed Contributor

Re: How to change the time and time zone

>Rita: if you change time settings you must be sure that you will not affect applications

This shouldn't apply if you are just changing timezones.
Kranti Mahmud
Honored Contributor

Re: How to change the time and time zone

Hi Senthil,

You didn't mention that you wanna go forward or backward.

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
Kranti Mahmud
Honored Contributor

Re: How to change the time and time zone

Hi Senthil,

To change the TIMEZONE, you need to do the following steps:

1. edit /etc/TIMEZONE so that it contains the following two lines:

TZ=CST-XXXX (XXXX=your desired time standard)
export TZ

2. edit /etc/default/tz

3.Edit the tztab file
# cd /usr/lib
#cp ├в p tztab /tmp/dst (copy tztab to /tmp/dst)
# vi tztab

4.#shutdown ├в ry now

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
Taifur
Respected Contributor

Re: How to change the time and time zone


Hi Senthil,

For changing time you can use

#date -u

For time zone, you have to edit
#vi /etc/TIMEZONE
&
#vi /etc/default/tz file

http://docs.hp.com/en/B3921-90010/timezone.5.html

Rgds//
Taifur
Dennis Handly
Acclaimed Contributor

Re: How to change the time and time zone

>Kranti: To change the TIMEZONE
>3. Edit the tztab file

There is no need to do this unless you are creating NEW timezones.

You can also simply export TZ in your .profile to your new timezone.
sujit kumar singh
Honored Contributor

Re: How to change the time and time zone

Hi


set_parms date_time
set_parms timezone

regards
sujit