LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   machine timezone (https://www.linuxquestions.org/questions/linux-general-1/machine-timezone-117422/)

sopiaz57 11-18-2003 10:33 AM

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?

LogicG8 11-18-2003 11:22 AM

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

sopiaz57 11-18-2003 12:13 PM

in my distro the timezone file is not a link at all, it's just machine code when i cat it.

jim mcnamara 11-18-2003 12:27 PM

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
export TZ

What do you see when you type:
Code:

echo $TZ

sopiaz57 11-18-2003 12:35 PM

when i do an echo $TZ i get a line feed and nothing else.

LogicG8 11-18-2003 12:54 PM

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.

sopiaz57 11-18-2003 01:18 PM

-rw-r--r-- 1 root root 1279 Jun 26 02:11 /etc/localtime


#file /etc/localtime
/etc/localtime: timezone data

LogicG8 11-18-2003 01:24 PM

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.

sopiaz57 11-18-2003 01:43 PM

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?

LogicG8 11-18-2003 02:09 PM

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.