System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure Time and Date correctly?

SOLVED
Go to solution
rustam_2
Super Advisor

How to configure Time and Date correctly?

Hi everybody,
My server rx6600 has wrong time and date. I want to change Time and Date by using
set_parm. I have NTP server in my network but there runs Windows 2003 Server and NTP Server is configured for domain.
So can i use this NTP Server for my rx6600 where runs HP-UX 11.v3 or cant?

If i will change and will not use NTP Server, are these steps correct?
1. # set_parms
2. Then type arguments (btw, are there a lot arguments to type)?

regards,
Rustam

10 REPLIES
Torsten.
Acclaimed Contributor

Re: How to configure Time and Date correctly?

See

man date

when not using NTP. But why not using NTP???
Be careful, don't go back in time when using databases or other critical applications.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Pete Randall
Outstanding Contributor

Re: How to configure Time and Date correctly?

Or, if you insist on using set_parms, run it like this:

/sbin/set_parms date_time

It asks if the current date/time is correct, you answer y or n. In your case, I assume you would enter "n" and then be prompted to enter the date, then the time.


Pete

Pete
Matti_Kurkela
Honored Contributor
Solution

Re: How to configure Time and Date correctly?

Windows W32Time service is not the same thing as NTP. W32Time can act as a NTP client, but I think you need some other program to run a NTP server on Windows.

Please note that NTP operates with UTC/GMT time only. This is how the NTP protocol is designed.

The system clock in a Windows system runs in local time, so the timezone setting in a Windows system running a NTP server *must* be correct, or the system will serve incorrect UTC/GMT time to its clients.

All NTP clients must also have correct timezone settings, or the NTP time will be converted incorrectly to local time.

Unix systems, including HP-UX, internally handle all time information in UTC-equivalent form (= Unix time_t timestamps) and store it that way. All time inputs are converted to UTC for processing and back to local time for output. In Unix systems, the system clock hardware typically uses UTC time.

All Unix systems are designed to be multi-user systems, and each login session can optionally specify a timezone just for his/her session if he/she is logging in remotely from a different timezone. System services will normally use the system-wide default timezone.

HP-UX servers come from the factory with the system clock already set to UTC time. Usually only minor corrections are needed when the system is installed.

If a HP-UX system indicates wrong local time, you should always check the timezone first:
1.) the TZ environment variable (user/session timezone):
- echo $TZ

2.) the /etc/TIMEZONE file (system default timezone)
- cat /etc/TIMEZONE

3.) If your timezone uses Daylight Saving Time, also verify that the DST definition is correct in /usr/lib/tztab. If the definition is incorrect, search for the latest tztab patch in the ITRC.hp.com patch database and install it.

4.) Does the system have a good idea of the UTC time?
- date -u

A tztab patch never requires a reboot for install, but you may want to restart all applications and system daemons if the DST definition for your system timezone has changed.

MK
MK
Matti_Kurkela
Honored Contributor

Re: How to configure Time and Date correctly?

Oops, it seems a Windows 2003 Server can act as a real NTP server with no extra software, if the registry setting

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NTPServer\Enabled

has been set to value 1.

Live and learn,

MK
MK
rustam_2
Super Advisor

Re: How to configure Time and Date correctly?

Thanks for all of you,
Torsten, they I installed Oracle DB but no information is in it. I just preparing server. I think it will not corrupt or change something there, isnâ t ?
Pete, I do this tomorrow when I will at work :
/sbin/set_parms date_time and put values when I will be prompted

Matti, About TIMEZONE. I checked and couldnâ t find file /etc/timezone. Yeah, I guess TZ was configured wrong, I typed

#Echo $TZ
WST-5WSTDST
But my TZ is +5 from Greenwich GMT

#date -u
Mon Apr 19 15:33:51 UTC 2010

So u think I have to update tztab to have actual data about timezone standards?
Matti_Kurkela
Honored Contributor

Re: How to configure Time and Date correctly?

The file is literally /etc/TIMEZONE, with ALL CAPITAL LETTERS. If it does not exist, your system timezone might not be configured... so you might want to run "set_parms timezone" too.

The sign of the timezone offset in the TZ value is a little strange. In "man 5 environ", it is defined as: (emphasis mine)

-----
- offset is the value that must be _added to local time_ to arrive at Coordinated Universal Time (UTC).
-----

This is somewhat counter-intuitive, but the POSIX standards say it must be like that. (I guess when Unix and the POSIX standards were developed in North America, the Americans wanted to use easy, compact positive integers for their timezones... but I digress.)

So if your timezone is 5 hours east from Greenwich GMT, the offset in the TZ=WST-5WSTDST seems to be exactly correct.

The next question is, is the definition of WSTDST in /usr/lib/tztab correct for you?

(/usr/lib/tztab is a text file, and it contains quite a bit of comments. The format description is available with the command "man 4 tztab".)

This thread contains the "dst.pl" script from A. Clay Stephenson, which can be used to verify the DST transitions specified by your configuration:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1165833

MK
MK
Steven E. Protter
Exalted Contributor

Re: How to configure Time and Date correctly?

Shalom,

Time zone is not going to really have an impact. Unix systems calculate time based on the number of seconds from Jan 1, 1970.

Time zone will only effect how it is displayed.

Notes:
NTP will only correct time that is off less than 16 minutes. Off by more than that, manual correction is required.

NTP makes adjustments by running the clock slower or faster. NTP does not set system time backward.

If you need to set the time back on a system, Oracle needs to be shut down. Changing time backward even a few seconds crashes oracle databases.

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
rustam_2
Super Advisor

Re: How to configure Time and Date correctly?

Thanks for everybody, i changed date and time. Now date and time are correct.

MK, i checked .bash_profile and there is not TZ value. But when i run
#env
i found out that TZ=WST-5WSTDST. Where did set this value? i mean where i can change or find this value? Should i update tztab file? Anywhere i couldnt find /etc/TIMEZONE, i mean TIMEZONE doesnt exist there.

SEP, i stopped Oracle DB before doing change. I changed then run DB. DB runs ok now. I determined that OS 'date and DB's sysdate are same.

Regards,
Rustam


Dennis Handly
Acclaimed Contributor

Re: How to configure Time and Date correctly?

>Where did set this value? I can change or find this value?

Possibly in /etc/profile. Or by sourcing /etc/TIMEZONE.
You can change it by setting it in your .profile.

>Should I update tztab file?

No, that should be considered a read only database.

>I couldn't find /etc/TIMEZONE, I mean TIMEZONE doesn't exist there.

You can always create it.
rustam_2
Super Advisor

Re: How to configure Time and Date correctly?

Thanks, Dennis. I found and did it.