How to Change the Date and Time on Amazon’s EC2 Instance

How to Change the Date and Time on Amazon’s EC2 Instance

Aziro Marketing |

24 Oct 2025

Amazon Elastic Compute Cloud (EC2) provides scalable virtual private servers using Xen. The instances running on Xen sync their wall clock periodically with the underlying hypervisor. For changing the datetime settings, few extra configurations are required.

On a simple Linux Machine the date and time can be simply changed by stopping ntpd service and setting the date as:
# date -s “2 OCT 2006 18:00:00” But on Xen server based virtual instance it’s not this simple!

The above command will not throw any error but will neither change the date. In order to change the date on Xen server based instance first, you need to set the wall clock to run independently from Xen.

This can be done simply typing the command:
echo 1 > /proc/sys/xen/independent_wallclock

To keep the setting between reboots, just add the following to the end of the file – /etc/sysctl.conf :
xen.independent_wallclock = 1

If you want to re-sync the wall clock with Xen, simply type the command:
echo 0 > /proc/sys/xen/independent_wallclock

# date -s “2 OCT 2006 18:00:00”

But on Xen server based virtual instance it’s not this simple!

The above command will not throw any error but will neither change the date. In order to change the date on Xen server based instance first, you need to set the wall clock to run independently from Xen.

This can be done simply typing the command:
echo 1 > /proc/sys/xen/independent_wallclock
To keep the setting between reboots, just add the following to the end of the file – /etc/sysctl.conf :
xen.independent_wallclock = 1

If you want to re-sync the wall clock with Xen, simply type the command:
echo 0 > /proc/sys/xen/independent_wallclock

How to Change the Date and Time on Amazon’s EC2 InstanceHow to Change the Date and Time on Amazon’s EC2 InstanceHow to Change the Date and Time on Amazon’s EC2 Instance

Real People, Real Replies.
No Bots, No Black Holes.

Big things at Aziro often start small - a message, an idea, a quick hello. A real human reads every enquiry, and a simple conversation can turn into a real opportunity.
Start yours with us.

Phone

Talk to us

+1 844 415 0777

Email

Drop us a line at

info@aziro.com

Got a Tech Challenge? Let’s Talk