LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-21-2010, 09:46 AM   #1
tuxtutorials
Member
 
Registered: Dec 2008
Location: New York
Distribution: RedHat, Solaris
Posts: 68

Rep: Reputation: 16
Different date shown for regular user and root user


Hello guys I am currently different dates between two users. When I am a regular user I see a different time stamp for the date command and when logged in as root I see a different time. See below:

[someuser@webserver ~]$ date
Wed Jul 21 14:38:02 UTC 2010
[someuser@webserver ~]$ su -
Password:
[root@webserver ~]# date
Wed Jul 21 09:38:10 CDT 2010

Could this be a permissions issue? I don't think this could be related to the .profile or .bashrc but a little stumped.

Thanks for any help.
 
Old 07-21-2010, 09:55 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Has someuser set their TZ environment variable?
echo $TZ
 
Old 07-21-2010, 09:57 AM   #3
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Definitely go with what Tredegar wrote -- further: maybe one time is in UTC (GMT) while the other is some timezone that is 5 hrs different from UTC.

EDIT -- Oop, it looks like exactly that: One is in UTC, and the other is CDT.
 
Old 07-21-2010, 10:04 AM   #4
djsmiley2k
Member
 
Registered: Feb 2005
Location: Coventry, UK
Distribution: Home: Gentoo x86/amd64, Debian ppc. Work: Ubuntu, SuSe, CentOS
Posts: 343
Blog Entries: 1

Rep: Reputation: 72
And http://www.linuxsa.org.au/tips/time.html

for some hints on fixing it
 
Old 07-21-2010, 11:25 PM   #5
tuxtutorials
Member
 
Registered: Dec 2008
Location: New York
Distribution: RedHat, Solaris
Posts: 68

Original Poster
Rep: Reputation: 16
Thank you very much guys for the tips. I will take a look at the $TZ variable. Never even knew this existed.
 
Old 07-22-2010, 09:54 AM   #6
tuxtutorials
Member
 
Registered: Dec 2008
Location: New York
Distribution: RedHat, Solaris
Posts: 68

Original Poster
Rep: Reputation: 16
Update

Issue solved! I set the TZ variable: "export TZ=US/Mountain" and it solved my difference in time. I will add to my .bash_profile. Thank you to all responders.
 
Old 11-27-2013, 08:33 AM   #7
Jaswanth
LQ Newbie
 
Registered: Nov 2013
Posts: 1

Rep: Reputation: Disabled
Question Jaswanth

Hi,I have the same problem in one of my server all the normal users (not 1 user) showing the different time zone and the root user have the different time zone. in this case you suggest to change the TZ in all the normal users bash profile ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
startx works as root but not as regular user Retne Slackware 14 07-04-2009 06:19 PM
Moving from root to regular user KingOfDreams Linux - General 1 01-14-2005 04:46 AM
Given regular user root privileges clo99dx Linux - Newbie 6 06-05-2004 04:27 PM
root apps running on X under regular user?? nny0000 Slackware 3 02-05-2004 02:09 PM
can't login as regular user (root only) DontKnowNothing Mandriva 2 10-24-2003 01:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration