Operating System - HP-UX
1848592 Members
5597 Online
104033 Solutions
New Discussion

Re: Change clock backwards

 
brian_31
Super Advisor

Change clock backwards

Team,

I want to change system clock back an hour for daylight saving & turn off automatic change. environment is 11.11.
Q: how do i do this

THanks

Brian



8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: Change clock backwards

First you would use the date command to set the date/time. Second, I would run /sbin/set_parms initial and, when you get to the time zone selection, select either one that has a "standard only" (no daylight) or the "unlisted time zone". Third, why in heaven's name would you want to do this?


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Change clock backwards

Hi Brian:

There should be no need to perform this. Daylight Saving transitions are handled automatically and your perception of time is adjusted accordingly.

However, if this is really what you want to do, then:

1. Stop all databases (at least) and any other critical things that are dependent upon an ever-ticking (foward) clock.

2. Use the 'date' command to reset your time.

3. Run:

# /sbin/set_parms timezone

...and choose a TZ value that doesn't have a Daylight Saving shift. You can create your own (see the manpages for 'tztab(4)'.

4. Reboot the server to restart 'cron' and all of your processes using the newly modified timezone.

Regards!

...JRF...
OldSchool
Honored Contributor

Re: Change clock backwards

if you've got databases involved, i'd leave them down for an hour as well. you don't know what side-effects you would introduce by doing this.

But I gotta ask: Why go to so much trouble?
Bill Hassell
Honored Contributor

Re: Change clock backwards

This is going to be a lot more complicated than you think. If you change the time now, then the system time (GMT) will be off by an hour. Then, depending on the timezone you have set in /etc/TIMEZONE, the time representation will be adjusted based on the values in /usr/lib/tztab, so you'll have to change the time forward.

Please note that HP-UX has a very simple method for handling timezone changes. The correct way to change the time is to modify /usr/lib/tztab. However, if you don't feel comfortable in learning about the format, then change the global TZ value in /etc/TIMEZONE. To remove the daylight saving adjustment, just remove the letters following the first number in the TZ value. For instance, EST5EDT would change to EST5. Do NOT make this change until you have shutdown your applications. Otherwise the time will appear to jump.

Once you have a TZ value with just 3 letters plus the offset number, no daylight saving adjustment will ever be made. While the system will run just fine, you have a big sysadmin job ahead, especially if your system provides or accepts data from other systems that have (or have not) been adjusted.


Bill Hassell, sysadmin
brian_31
Super Advisor

Re: Change clock backwards

Honestly, i am not too sure why they have decided to do this. BTW how do you change the date using the date command? can SAM be used?

Thanks

Brian
James R. Ferguson
Acclaimed Contributor

Re: Change clock backwards

Hi Brian:

To change the time (and/or date) with the 'date' command, do:

# date [-u] mmddhhmm[yy]

...see the manpages for more information.

Regards!

...JRF...
brian_31
Super Advisor

Re: Change clock backwards

i change the date using date -u (or sam) and then ran the /sbin/set_parms and selected the option 4 (for eastern standard daylight) and when the system comes up it shows 2 hours behind eastern time. pl advise

Thanks

Brian
James R. Ferguson
Acclaimed Contributor

Re: Change clock backwards

Hi (again) Brian:

Well, when you did 'date -u mmddhhmm' what did you specify?

Using 'date -u' means that your are setting or querying UTC (GMT) time.

Option-4 of 'set_parms' timezone should be "EST5" or 5-hours behind UTC.

Compare these:

# TZ=UTC date
# TZ=EST5 date
# TZ=EST5EDT date

Notice that there is a whitespace (blank and/or tab) character after the 'TZ' variable is set and before the date command. This format sets TZ *only* for the duration of the commandline, thereby allowing convenient testing.

You need to reset your server's UTC time to the *correct* value. You can obtain it here:

http://tycho.usno.navy.mil/cgi-bin/anim

Regards!

...JRF...