machine timezone
I have looked all through the date man page, cant seem to figure out how to change my server from mountain time to Eastern time. any suggestions?
|
Change
/etc/localtime it's usually a symlink to someplace else. ls -l it go to that directory and look for the timezone that appeals to you and replace the symlink in /etc with a new one pointing to your brand new timezone |
in my distro the timezone file is not a link at all, it's just machine code when i cat it.
|
Something is not right here. The system clock is set to UTC.
System time routines use the environment variable TZ to correct UTC to the locale, using a C routine called localtime() -- which looks up the TZ variable. All process are on the same "timezone" page because they all have done something like this: Code:
TZ=MST7MDT Code:
echo $TZ |
when i do an echo $TZ i get a line feed and nothing else.
|
What do you mean it's not a link?
if you cat a symlink it will cat the file the symlink points to. What is the output of ls -l /etc/localtime TZ isn't defined for me either. |
-rw-r--r-- 1 root root 1279 Jun 26 02:11 /etc/localtime
#file /etc/localtime /etc/localtime: timezone data |
Check to see if you have
/usr/share/zoneinfo/ You can do what your Distro apparently did and just cp the right file from there. |
Ok i have that zoneinfo directory with tons of time zones in it, as well as an America folder with different cities. So I should copy one of these files to /etc/timezone?
|
yes, cp your desired timezone file to /etc/localtime
or you can create a symlink ln -sf /usr/share/.../my_tz /etc/localtime |
All times are GMT -5. The time now is 08:38 PM. |