1833873 Members
2007 Online
110063 Solutions
New Discussion

date problem

 
SOLVED
Go to solution
thebeatlesguru
Regular Advisor

date problem

boy boy boy
i find a strange problem:
i use root:
# date
Mon Jul 15 04:50:16 EDT 2002

use pin
tsrad22>date Mon Jul 15 16:50:48 EAT 2002

time is different(two date command used within one minute),whats up
i think its impossible hehe
hihi
14 REPLIES 14
Peter Kloetgen
Esteemed Contributor

Re: date problem

Hi Guru,

is it possible, that your user "pin" is using a home directory on a different computer using NFS? This would be an answer to your question, if on the other computer a different time zone is used. Or is a different time zone given for your user in /$HOME/.profile or in .dtprofile?

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Patrick Chim
Trusted Contributor

Re: date problem

Hi,

If you set the environment variable TZ to another timezone and type 'date, you will give different datetime also.

Try to 'echo $TZ' at each user level and see
what is the difference.

As you can see the timezone of the date is EDT and EAT.

Regards,
Patrick
Michael Tully
Honored Contributor

Re: date problem

Hi,

Your problem is related to different timezones being used for two different users.

The 'real' timezone should be set for your system from the /etc/profile file which also refers to /etc/TIMEZONE. If either of these differs to what you standard user is, then one eor the other is wrong. Select the correct timezone for you and update the appropriate files. Have a look at /usr/lib/tztab for more information.

To get each timezone use this command:

$ echo $TZ

Michael
Anyone for a Mutiny ?
V. V. Ravi Kumar_1
Respected Contributor

Re: date problem

hi,

it is difference in the time zone EAT & EDT.
otherwise u can check AM/PM. because for example 4:50 without AM or PM specification is equl to 16:50 PM.

regds
ravi
Never Say No
Niraj Kumar Verma
Trusted Contributor

Re: date problem

hey !!

try

# telnet 13

see whats the result !!

-Niraj
Niraj.Verma@philips.com
Trond Haugen
Honored Contributor

Re: date problem

Check the $TZ variables for the two users.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Darrell Allen
Honored Contributor

Re: date problem

Hi,

"date" uses the TZ environmental variable to format its output. Apparantly one user has $TZ set to something with EDT and the other has EAT. On my systems, EAT does not exist in /usr/lib/tztab. This causes date to use UTC, just the same as using "date -u".

Do "echo $TZ" for each user and compare the results. Also, check for both TZ settings in /usr/lib/tztab. If either isn't found, "date" is using UTC for that even though may display EAT.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
thebeatlesguru
Regular Advisor

Re: date problem

thats right,the root doesnt set the TZ ,now i wanna set it in ENV,and i use:
export TZ=EAT-8

but it dont work next time i login

maybe i should write it in a file ,but which file?
hihi
Michael Tully
Honored Contributor
Solution

Re: date problem

Hi,

Please post the output of this from your /etc/profile starting here:

# Set the TIMEZONE

if [ -r /etc/TIMEZONE ]
then
. /etc/TIMEZONE
else
TZ=MST7MDT # change this for local time.
export TZ
fi

and the output of /etc/TIMEZONE file.

Anyone for a Mutiny ?
RAC_1
Honored Contributor

Re: date problem

date is same. Check TZ variable for both users. They have to be different.

Regards,
There is no substitute to HARDWORK
Michael Tully
Honored Contributor

Re: date problem

okay... If they have to be different to the default or global setting do this:

$ export TZ=EAT-8

To make it permanent change directory to users home directory and edit there .profile file and add the same entry as below, and save the file.

export TZ=EAT-8
Anyone for a Mutiny ?
harry d brown jr
Honored Contributor

Re: date problem

SHAMELESS?

This member has assigned points to 63 of 219 responses to his/her questions

http://forums.itrc.hp.com/cm/TopSolutions/1,,CA752374!1!questions,00.html

live free or die
harry
Live Free or Die
thebeatlesguru
Regular Advisor

Re: date problem

to brown

i have pointed all respones to my question

i didnt mean to it,i jsut forget about it :(

sorry for everyone
hihi
harry d brown jr
Honored Contributor

Re: date problem


GREAT job! I realize it probably took some time, but you did it, and we thank you!

This member has assigned points to 209 of 220 responses to his/her questions.

What an improvement!

give me an N/A here

live free or die
harry
Live Free or Die