- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Problems in getting the right time
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2000 12:02 AM
07-27-2000 12:02 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2000 12:27 AM
07-27-2000 12:27 AM
SolutionThe time() function should return about the same on all the machines. It's time since epoch (1/1/1970).
Also, ensure that you've not changed the kernel parameter timezone. It should be 420.
Lots of people do that instead of just setting TZ (/etc/TIMEZONE).
The other thing you can do, is run ntp on the machines, so they all have exactly the same time.
http://www.eecis.udel.edu/~ntp/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2000 12:27 AM
07-27-2000 12:27 AM
Re: Problems in getting the right time
It's worth comparing the value returned by time() on all the machines. It should be the same (or maybe a few seconds out).
Check /etc/TIMEZONE on all the machines is the same.
Check also, that you haven't changed the kernel parameter 'timezone' from it's default of 420. Lots of people do that, instead of changing /etc/TIMEZONE.
You could also run ntp to ensure all the times (in UTC) are the same :-
http://www.eecis.udel.edu/~ntp/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2000 08:32 AM
07-29-2000 08:32 AM
Re: Problems in getting the right time
It is not too difficult to have the wrong
system time and the wrong timezone environment variable so that the result shows the correct local time from the output
of the date command.
You can compile and run a simple program such as:
#include
main()
{
time_t t;
t=time((char *) 0);
printf("The raw time is %dn",t);
system("echo "The TZ environment variable is:*$TZ*"");
system("echo 'This results in the following local time:';date");
}
When this is compiled and run you should get
something like:# cc time.c -o time.exe
# ./time.exe
The raw time is 964887236
The TZ environment variable is:*EST5EDT*
This results in the following local time:
Sat Jul 29 12:13:56 EDT 2000
All you systems should have the same raw system time. Everything else is controlled by the way the os converts raw time to local time (TZ environment variable) which can be altered by the user's login initialization scripts (.kshrc, .profile, .cshrc, etc...)
A good way to sync the clock on multiple systems is by enabling NTP via sam. Then any
local time errors should be due to incorrect
timezone settings.
I disagree with the previous statement that
the timezone variable should be 420, unless that is the correct offset for your local timezone. I set mine to what I believe is the correct setting (300), but from what I could tell by experimenting with it and reading the man pages, it's only used if there is no other timezone information available.
Please post something back when you find out what is causing your problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2000 03:30 PM
08-02-2000 03:30 PM
Re: Problems in getting the right time
To keep your machine times in sync use ntp (network time protocol). If you are lucky enough to have a firewall that you can sync to a central time clock, fine, if not,
use the machine that drifts the less (IF YOU HAVE a look at the time specs on hp the drift can be quite large). To determine this keep a record of an accurate time set, and check a month later, which machine has deviated the least, should be the ntp master.
.Email me if you want more info on ntp.
PS. I am another Finn, just from Down under.