1834391 Members
1640 Online
110066 Solutions
New Discussion

Re: Timezone issue . . .

 
piyush mathiya
Trusted Contributor

Timezone issue . . .

Gurus,
I have some issue in tz. Please check the below output which can use to diagnose the exect problem. . .

Thanks & Regards,
Piyush Mathiya

=============================================
######### Defined time zone #############
# echo $TZ
CST6CDT
# cat /etc/default/tz
CST6CDT
# date
Tue Jul 8 14:52:28 CDT 2008
# env | grep -i tz
TZ=CST6CDT
######### In profile ####################
# cat /etc/profile | grep -i tz
TZ=MST7MDT # change this for local time.
######### In login time #################
Last successful login for mssun: Mon Jul 7 22:21:13 EST5EDT 2008
Last unsuccessful login for mssun: Mon Jul 7 15:18:07 EST5EDT 2008 on
Your password will expire on Fri Jul 11 19:23:00 EST5EDT 2008

---------------------------------------------
Can you please check, why it is different Time zone. My main proble is which TZ value "login" command is use.
6 REPLIES 6
Tim Nelson
Honored Contributor

Re: Timezone issue . . .

The TZ setting in /etc/profile will override all others.

piyush mathiya
Trusted Contributor

Re: Timezone issue . . .

Tim,
Thanks for the reply, But my question is why it is showing EST5EDT after login.

Regards,
Piyush Mathiya
SKR_1
Trusted Contributor

Re: Timezone issue . . .

Dear Piyush,

Check /etc/TIMEZONE file.

Thanks,

Sunil
Tim Nelson
Honored Contributor

Re: Timezone issue . . .

Sorry, did not see the difference between MST7MDT and EST5EDT, ooops.

Then /etc/TIMEZONE may be the place to look.

piyush mathiya
Trusted Contributor

Re: Timezone issue . . .

It is also like this,
# cat /etc/TIMEZONE
TZ=CST6CDT
export TZ

And I think at the time of login TZ is showing EST5EDT, and after that with the use of /etc/TIMEZONE, it is changing to CST6CDT. "EST5EDT" is the time zone which may be define at the installation time. What you are thinking?

Regards,
Piyush Mathiya
Armin Kunaschik
Esteemed Contributor

Re: Timezone issue . . .

Since TZ is an environment variable it's inherited by the parent process.
Changing variables in files (any location) does not change the environment of any running processes.
So if you change TZ and do not restart sshd/inetd etc, the process will use the old TZ. Even if you change TZ in the login profile, the process will display the wrong time... remember: the login messages are not display by the shell!

The (probably) easiest way would be to reboot the system... that "restarts" all processes.

My 2 cents,
Armin

PS: Please assign points if you find answers useful!
And now for something completely different...