Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the time zone in Amazon EC2?

I want to change the time zone set in my Amazon EC2 instance running Ubuntu Linux to local time?

My Question

How to change the time zone in Amazon EC2?

like image 372
Gaurav Agarwal Avatar asked Aug 13 '12 09:08

Gaurav Agarwal


People also ask

How do I change the timezone in AWS?

On the AWS Elemental Server web interface, go to the Settings page and choose General. In Timezone, choose your required time zone. Choose Update.

How do I change the timezone on my EC2 instance Windows?

Change the time zone You can change the time to correspond to your local time zone or a time zone for another part of your network. From your instance, open a Command Prompt window. Locate the time zone ID to assign to the instance. The new time zone should take effect immediately.

How do I change my AWS EC2 Availability Zone?

It's not possible to move an existing instance to another subnet, Availability Zone, or VPC. Instead, you can manually migrate the instance by creating a new Amazon Machine Image (AMI) from the source instance. Then, launch a new instance using the new AMI in the desired subnet, Availability Zone, or VPC.

How do I launch EC2 instance in local zone?

To launch the instance in a Local Zone, select a subnet that you created in the Local Zone. To launch an instance in an Outpost, select a subnet in a VPC that you associated with an Outpost. Auto-assign Public IP: Specify whether your instance receives a public IPv4 address.


2 Answers

it should be no different than your desktop Ubuntu process. See here

  1. SSH to your EC2 server
  2. execute the following (to set timezone to Australia/Adelaide)

    $ echo "Australia/Adelaide" | sudo tee /etc/timezone Australia/Adelaide $ sudo dpkg-reconfigure --frontend noninteractive tzdata  Current default time zone: 'Australia/Adelaide' Local time is now:      Sat May  8 21:19:24 CST 2010. Universal Time is now:  Sat May  8 11:49:24 UTC 2010. 

Update

You can use tzselect utility to browse through. See here: http://manpages.ubuntu.com/manpages/precise/man1/tzselect.1.html

It's an interactive software. My Ubuntu (11.10) has it.

You could also refer this Wikipedia article

Brazil

Brazil/Acre Brazil/DeNoronha Brazil/East Brazil/West 
like image 131
Nishant Avatar answered Oct 13 '22 09:10

Nishant


Another way of changing the time (This was done on an Amazon EC2 Linux instance)

Remove your localtime file

sudo rm /etc/localtime 

Change Directory to ZoneInfo

cd /usr/share/zoneinfo 

This folder contains all of the timezone information. You then just need to softlink to the appropriate zone.

Create a softlink to /etc/localtime

sudo ln -s /usr/share/zoneinfo/GB /etc/localtime 

That will change your server timezone to GB

like image 31
ajtrichards Avatar answered Oct 13 '22 09:10

ajtrichards