1835429 Members
4101 Online
110078 Solutions
New Discussion

Time Problem

 
YOGI_3
Frequent Advisor

Time Problem

Hi,
I am getting different time for different logins on same server.
Why it is so?
Waiting for reply..


Yogesh
There is never a wrong time to do the right things
8 REPLIES 8
Muthukumar_5
Honored Contributor

Re: Time Problem

Can you give us the example with 3 logings with date execution information. Is there anything in /etc/profile or .profile with date settings?

hth.

Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Time Problem

Just send us an example .profile from your system where you see the difference. Look for anything that starts with GMT or Timezone.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Sudeesh
Respected Contributor

Re: Time Problem

Check if the TZ variable is set diffrent for these users. I think they have diffrent time zones set in the profile file.


Sudeesh

The most predictable thing in life is its unpredictability
Arunvijai_4
Honored Contributor

Re: Time Problem

Just look for TZ in .profile.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
James R. Ferguson
Acclaimed Contributor

Re: Time Problem

Hi:

I would suspect that the different user profiles contain different TZ variable settings. Remember, server time is kept in UTC (GMT) but the perception that a user has is based on his/her offset from that through the TZ variable.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: Time Problem

There is only one time of day kept on HP-UX: UTC (also known as UTC). Because there are dozens of timezones around the world, each with a (politically) different set of rules, HP-UX uses the TZ variable to translate the time into what you see with the date command and system calls. If you change the local copy of TZ, you can have any time you would like. For instance, these commands show you different times around the world:

TZ=CST6 date
TZ=CST6CDT date
TZ=EST5EDT date
TZ=GMT0 date
TZ=NST3:30NDT date
TZ=CST-9:30CDT date
TZ=BILLH1:23 date

Oh, the last timezone is my own. I decided to create my own timezone by following the rules in the man page for environ. See this thread for more details: http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=955491

HP-UX sets the global timezone in one file: /etc/TIMEZONE. Everyone with a normal login will have this value. Of course, normal users can edit their .profile and change anything including TZ.


Bill Hassell, sysadmin
Muthukumar_5
Honored Contributor

Re: Time Problem

Every user is having an option to change their environment settings with .profile in $HOME directory. They can change settings like prompt, date, umask and misc. things there.

cd /home/

find / -name ".profile" | xargs grep -iE 'TZ|date'

what u r getting there.

P.S: I hope users are having home directory /home

hth.

Easy to suggest when don't know about the problem!
Jeff Lightner_1
Frequent Advisor

Re: Time Problem

.profile is for sh and ksh. You may need to look at .login if the user is using csh.