LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   System time correct for root, wrong for normal user? (https://www.linuxquestions.org/questions/slackware-14/system-time-correct-for-root-wrong-for-normal-user-466343/)

dx0r515t 07-21-2006 03:36 PM

System time correct for root, wrong for normal user?
 
My system time for root is correct, but for my normal user account it is wrong. The time in the BIOS is correct as well. I ran timeconfig as root and set the hardware clock to localtime and then set the correct timezone. Again as root the time is correct, when I run date as root I get this:

Quote:

bash-3.00# date
Fri Jul 21 16:26:16 EDT 2006
But when I run date as my normal user account I get this:

Quote:

bash-3.00$ date
Fri Jul 21 20:26:58 UTC 2006
I did notice that when I run as root and type "date" it says "EDT" next to the time (which is correct) but as a normal user it says "UTC". How do I change the time for my normal user so it's the same time as it is for root?

As root I can change the time with date -s xx:xx but when I try as a normal user I get "operation not permitted". I understand I am probably getting this error becuase I am trying to change the global system time as a normal user.. so how do I go about setting the correct time for my normal user account? It seems like there should be some kind of a command I can enter as root that will change the time for all users.
:confused:

bathory 07-21-2006 04:51 PM

Take a look at /etc/localtime:
Code:

ls -l /etc/localtime
and if the permissions are rw--- change it to rw-r-r.
Or as root run:
Code:

echo $TZ
to see if you've defined somehow the TIMEZONE and use that TZ in /etc/profile, so it's the same for all users. I.e. edit your /etc/profile and at the end add a line like this:
Code:

export TZ=EDT
Of course change EDT with the root's TZ.

Regards

dx0r515t 07-21-2006 05:30 PM

Thanks
 
Thanks bathory I did chmod 644 /etc/localhost as root and now the time is correct as a normal user.

Thanks again.


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