[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Scripted method to change TZ from UTC to a specific timezone?



James Wu <JWu@eyereturn.com> wrote:
> When I run the cmd "date", I get UTC time on a fresh boot of an imaged
> machine. I'd like to find a way to set the time to "America/New_York"
> for automatically via script. A reboot is ok if absolutely needed but
> not preferred.

mv -f /etc/timezone /etc/timezone.old
echo America/New_York >/etc/timezone


> I've tried the following methods without success:
> "cp /usr/share/zoneinfo/America/New_York /etc/timezone"

If you look at the original contents of /etc/timezone before you overwrite
it, you'll see it's a timezone name not a zone file. (At least, on my
Debian box it is so.)


> + changing
> "UTC=yes to UTC=no" in /etc/default/rcS 

Don't do that!


> I even tried rebooting afterwards

In the case of changing the system default timezone this is probably
not such a bad idea.

Chris


Reply to: