• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to Check and Set Timezone in Ubuntu

787

To Check and Set Timezone in Ubuntu

In this article we going to show how to check and set Timezone in simple way on Ubuntu machine. It is necessary to ensure and maintain an accurate log time-stamps in distributing systems.


To Check Timezone

First try a traditional command " date" to check the Timezone.

root@linuxhelp:~# date
Tue Nov 15 19:50:21 IST 2016

Use another command ' timedatectl' .

root@linuxhelp:~# timedatectl
Local time: Tue 2016-11-15 19:51:23 IST
Universal time: Tue 2016-11-15 14:21:23 UTC
RTC time: Tue 2016-11-15 14:21:23
Time zone: Asia/Kolkata (IST, +0530)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no

You can also use timedatectl with grep command.

root@linuxhelp:~# timedatectl | grep " Time zone" 
Time zone: Asia/Kolkata (IST, +0530)

Another simple method to check the timezone is using " cat" command.

root@linuxhelp:~# cat /etc/timezone
Asia/Kolkata

The strings command also displays the timezone.

root@linuxhelp:~# strings /etc/localtime | tail -n 1
IST-5:30

Move to the zoneinfo location and execute below command to check timezone in different way.

root@linuxhelp:~# cd /usr/share/zoneinfo
root@linuxhelp:/usr/share/zoneinfo# find * -type f -exec sh -c " diff -q /etc/localtime ' {}'  >  /dev/null & &  echo {}"   
Asia/Calcutta


To Set Timezone

Run the below command to set the time zone.

root@linuxhelp:~# dpkg-reconfigure tzdata

Select your continent.

Check-and-Set-Timezone-continent

Select your city.

Check-and-Set-Timezone-city

After selecting the timezone, it displays the output as shown below,

Current default time zone: ' Asia/Kolkata' 
Local time is now: Tue Nov 15 19:58:25 IST 2016.
Universal Time is now: Tue Nov 15 14:28:25 UTC 2016.

Also use timedatectl command to set timezone.

root@linuxhelp:~# timedatectl set-timezone Asia/Kolkata

Once the timezone is set, check and verify your settings with the following command.

root@linuxhelp:~# timedatectl
Local time: Tue 2016-11-15 20:00:07 IST
Universal time: Tue 2016-11-15 14:30:07 UTC
RTC time: Tue 2016-11-15 14:30:08
Time zone: Asia/Kolkata (IST, +0530)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no

Tags:
lucas
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

How to list out all valid Timezones present?

A

Please execute the below command
# timedatectl list-timezones

Q

How to change Ubuntu server's date and time via cli?

A

Please execute the below command
# date "30 Sep 2015 4:43:42"

Q

I have executed the command date "30 Sep 2015 4:43:42" which simply shows date and time?

A

Use " # hwclock --show" to verify the stated issue.

Q

How to set the timezone for the particular region via command line?

A

In order to set time for Asia/Kolkata set as follows # timedatectl set-timezone Asia/Kolkata.

Q

How to check, that what time zone has already enrolled?

A

For attaining the default time zone set on your machine use #timedatectl | grep " Time zone".

Related Tutorials in How to Check and Set Timezone in Ubuntu

Related Tutorials in How to Check and Set Timezone in Ubuntu

How to Check and Set Timezone in Ubuntu
How to Check and Set Timezone in Ubuntu
Nov 25, 2016
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Jayce ?
What are the types of table used in IPtables

What are the various types of table used in IPtables and how to use that for my server security?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.