Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an Amazon EC2 dedicated instance (Fedora Linux). Although I took an instance in US West, it came set to EST.
I changed the timezone to PST (export TZ=America/Los_Angeles) and it works - for several hours. Then it resets itself to EST.

What am I doing wrong and how can I set it to PST permanently?

share|improve this question
add comment

3 Answers 3

up vote 14 down vote accepted

I don't run Fedora for my EC2 instances as I need something stable for more than 6 months, so I use CentOS... But it should be the same... Just run the following:

ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

That should change your systems default timezone to PST and should only be affected when the instance is brought up from scratch.

share|improve this answer
1  
Thanks! Also for the CentOs note. You're the second one to tell me the same this week. –  Traveling Tech Guy Feb 6 '10 at 8:03
    
With Fedora's release every 6 months and only support the most current 3 versions policy you're unsupported after 18 months. –  Jeremy Bouse Feb 6 '10 at 15:09
    
+1, worked like a charm. For those non-sysadmins like me, prefix with sudo –  Jason McCreary Nov 29 '11 at 4:03
add comment

Change the ZONE setting in /etc/sysconfig/clock

share|improve this answer
    
No such file in /etc/sysconfig :( –  Traveling Tech Guy Feb 6 '10 at 2:39
1  
@TravelingTechGuy the file is there for Amazon Linux AMI (Centos). I'm not sure if it's there for other types of AMI –  fuzzybee Jan 30 '13 at 7:17
add comment

Have the config for setting timezone in your .bashrc .

In case you are looking for using the TZ in your application from the system, its a bad idea since EC2 instances that go down/crash can be a different system when they come back up.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.