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

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

Hi all,
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.
I'm aware that I can run "dpkg-reconfigure tzdata"  but that requires user input.
I've tried the following methods without success:
"cp /usr/share/zoneinfo/America/New_York /etc/timezone" + changing "UTC=yes to UTC=no" in /etc/default/rcS
I even tried rebooting afterwards
I've also tried "echo 'America/New_York' > /etc/timezone" as well instead of copying.
Am I missing something? Is there another way to change the tzdata from UTC without requiring user input?

Reply to: