Change Your Timezone In Linux

Today’s article is an easy one about how you can change your timezone which isn’t something you’ll likely need to do all that often. It’s not all that complicated, though it can look like it is. It can be a bit tedious, but that’s just at first blush. I’ll show you how to make it a bit easier.

NOTE: This is actually a duplicate. I wrote it some time ago and realized it was a duplicate, or reasonably close to another article. I decided to save it and publish a duplicate article when an ’emergency’ came up. Well, we have an ’emergency’. I had too many adult beverages before it was time to write a new article. So, you get this one.

Now, the title is obviously not correct. You’re not going to change your timezone, you’re going to change the timezone settings your computer is using. Alas, headlines aren’t to be all that long and are allowed to make some assumptions. If you want to change your timezone, you’ll have to move.

This article is only useful to you if you use systemd.

My regular readers may have noticed a giant outage. Linux-Tips.us was unreachable for a good part of the 6th. My initial assumptions were that we’d been hacked, that is that WordPress had become compromised. That’s a reasonable assumption.

It turns out that we’d been moved to a new data center. We’re now located in New York. I use a CDN that relies on an IP address. There are a bunch of DNS records behind the scenes. Those records had to be updated. That wasn’t a major task, but troubleshooting the problem was the challenge.

Everything turned out okay and I won’t even miss a scheduled publication. Of course, I’m writing this at 04:45, but you will have your article today. So far, I haven’t missed a publication date. I’m quite amazed by this.

Speaking of today’s article, we’re going to be learning how to change your timezone. We’ll be doing this in the terminal and the tool we’ll be using is known as timedatectl. If your distro uses systemd, you have this installed. When you check the man page (with man timedatectl) you’ll see that timedatectl defines itself as:

timedatectl – Control the system time and date

As you can see, this is probably the right tool for the job – assuming the job is changing your timezone. Seeing as that’s what the title says we’ll be doing, we might as well do that.

Change Your Timezone:

As mentioned in the introduction portion of this article, you’ll be doing the work in the terminal. It’s often easy to open a terminal with a keyboard shortcut. Frequently, you can open your default terminal by just pressing CTRL + ALT + T. Otherwise, look in your application menu. That’d be a good spot to look for a way to open your terminal.

With your terminal open,  you can enter the following command to see what you have for your current timezone settings:

Before you can change your timezone you have to know what time zones are available. There are a whole lot of them, meaning you can be scrolling for quite a while. Go ahead and enter this command:

(You can press CTRL + C to get out of that.)

So, what we’re going to do is narrow down the results shown to you. You’ll need to know the region you’re in, such as Europe, Africa, America, etc for this next part and we’re going to use a pipe and grep (which we’ve used in the past). For me, I’d want to set my timezone to New York in America and my command would look like:

You’ll note that this is case-sensitive. Listed in the output would be the text I’m after, the text needed for the command that lets you change your timezone. It looks like this:

With that information available, I can now complete the command to change my timezone to that of New York. That command is easy enough. It just looks like:

Or, when using my location as the example, the command looks like this:

It’s not too daunting a task to change your timezone. If you entered the wrong timezone during installation, you can trivially change it to the correct timezone.

I should mention that your computer will use NTP to keep your system’s clock set. This is also stored in your system’s hardware. The CMOS battery keeps that and other settings stored while the power is disconnected. This battery can go bad.

If that battery does go bad, you may find yourself setting the date and time of your system every time you start your computer. NTP should then kick in and keep your system’s time updated. For reasons deeper than this blog will go, your system depends on time (specifically Unix Time) in all sorts of applications.

Closure:

Well, there was some drama. The site was down for an extended period and this article wasn’t written until the wee hours of the morning. However… However, I didn’t miss a publication date. Also, I just realized I haven’t done a meta article in a while.

With some great help from the hosting company upstream, everything was resolved and you got an article about how to change your timezone in Linux. All’s well that ends well.

While there are backups, my heart sank when I thought that the site had been hacked. Cleaning that mess would have been tedious. Fortunately, that wasn’t required. No data was lost and we can move on knowing that it’s just a footnote in the site’s history.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Change The Timezone

In today’s article, I’m going to show you how to change the timezone. This isn’t a task you’ll need to do often, but it’ll be nice to know how to do it when you do need to change the timezone.

Personally, I find myself mostly needing to change the timezone when I lease a VPS and want the system timezone to match my own timezone. All in all, the  computer doesn’t actually care what timezone it is in, so you can set it to your local timezone and not have any issues. Normally, I’d configure the timezone during the installation process.

I suppose this is probably only going to work in systems that make use of systemd. It makes use of timedatectl and I’m pretty sure that’s a systemd thing. If this was a good site, the author would actually go verify this. You get what you pay for! Still, you may need another tool if you don’t use systemd.

It’s also going to be a fairly easy article. If you want to change the timezone, it’s not all that difficult. There really isn’t a whole lot to it. So, without further ado, let’s get into the article…

Change The Timezone:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

I suppose you should first know what timezone you’re currently using. To learn that information, you can use this command:

Your output might look something like this:

timedatectl output
Your timedatectl output may look different, obviously. You might not be in my timezone!

Anyhow, to change it, the format of the command is:

I suppose you might not know your timezone options. You can generate a giant list of ’em with this command:

If you don’t know your timezone options, you can use ‘grep’ to narrow it down. For example, if you’re pretty sure you’re in America, your command might look a little like:

That’ll narrow it down. By the way, the  “America” in this case actually more like ‘the Americas’ and far more than just the United States – or even  more than North America. That information might come in handy for some of you.

Closure:

Whelp, there you have it… You have another article. This one will show you how to change the timezone, which might be something you need to know from time to time. It’s probably not something you need to remember, but now you can easily search for it.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Find Your Linux System’s Timezone

This article, telling you how to find your system’s timezone, is more aimed at server users than desktop users. Desktop users probably know this already.

This command is most useful when you’re dealing with servers across the globe. You may want to schedule things (for one small example) to run at local times and knowing the local time will help with that. Knowing the timezone is pretty important, and the timezone itself is important.

The timezone dictates things like when your clocks change to adjust for Daylight Savings Time. While that may not seem like a big deal, having the proper date and time is a big deal. So, this article will tell you a couple of quick and easy ways to find your Linux system’s timezone.

Find Your Linux System’s Timezone:

This is going to need an open terminal. You probably could have guessed that. You can open a terminal with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal open, you can try one of the following commands (I prefer the first):

The second option is easier to remember, but you don’t get the full name of your timezone. It may require a bit more thinking, just to be sure. Try:

And the timezone will be at the end of that string of characters. If you’re still confused, you can type the abbreviation into your favorite search engine and they’ll get you sorted out.

Thee is a third way, but keeping that way crammed into memory isn’t as easy as the date command. It’s just:

Of course, you can just use ​’timedatectl’ without grep. That’s a viable option, it just spits out more information. So, if you were to remember just one of the commands, the third one is probably the best.

Those are three ways I know of to find the timezone within the Linux terminal. It may show up in the GUI. If you want to add it to your system’s time display, you add %Z to the string (ISO 8601 standardizes this) and it’d look something like this when you changed it and the change took place:

Using the #Z to show the timezone in the system clock.
Tada! That’d be how you’d do that!

So, you can display the timezone in the GUI if you really needed to. But, this article is mainly for those who admin servers across the globe and need to know the timezone the system is in.

Closure:

Woohoo! Another article done and ready to publish. However, I’m going to leave this one unscheduled (scheduled way in the future) so that I have an ’emergency’ article, an article that can be used when Mother Nature has taken out my ‘net or motivation just isn’t there.

Either way, this article covered how to find your timezone in Linux. It’s information you may want, and information you may want to check before rolling out changes. The data is in the system, we just need to pry it out.

How To: Find Your Timezone In The Terminal

This article is about your system time, specifically how to find your timezone in the terminal. It shouldn’t be a very long article and it should be relatively easy and suitable for new Linux users.

Why would you want to find your timezone in the terminal? Well, for starters you may not have the proper time set and need to verify it. You may also be working with servers scattered across the globe and knowing the timezone may be important.

As you may need things synchronized, knowing the timezone could be important. Seeing as you’re not always able to access a GUI desktop, you might want to find your timezone in the terminal. So, to those end, this article will share a few ways to do so.

Find Your Timezone In The Terminal:

Obviously, this article requires an open terminal. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open. If you’re operating remotely, you probably already have a terminal open.

Anyhow, there are multiple ways to do this. For starters, you can just use the date command. It looks like this:

The output will have your timezone in it. For example, the output of that command on one of my boxes looks like:

As you can see, the timezone is at the end. In my case, it’s “EDT” and that’s probably the easiest way to get the timezone information.

You can also use ‘timedatectl’ which looks like this:

That’ll give you the timezone and even tell you the adjustment from GMT. If you want, you can use grep with it.

That will, of course, just output the line containing your timezone. Also, I have no idea why it’s two words. I know it as one word, but here we are and I suppose it’s just not that important.

I have one more way to find your timezone in the terminal and it’ll output your timezone in text. It’s just:

The output from that would look a little like this:

So, there are a few ways. There are surely other ways, so feel free to leave a comment sharing them.

Closure:

And there you have it, another article. This one shares how to find your timezone in the terminal. It’s a relatively easy article to follow and not really a tool I expect most users to need. Still, it’s there if you need it and this article stands as a reference to it.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips