How to change Time zone in Linux


Method 1: Creating link file to corresponding Timezone

# cd /etc
# rm localtime  //delete the existing localtime file

Check the available time zones in US

# ls /usr/share/zoneinfo/US/    
Alaska          Arizona         Eastern         Hawaii          Michigan        Pacific
Aleutian        Central         East-Indiana    Indiana-Starke  Mountain        Samoa

Note: For other country timezones, browse the /usr/share/zoneinfo directory

Now we can change the time zone using below step

# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime

Now check the time

#date 

# date
Mon Aug 17 23:10:14 IST 2013

But if you are doing any patching then after patching this Time zone will get changed. So this method is not perfect one.


                                            




Method 2: Change TimeZone Using /etc/timezone File


# vi /etc/timezone
America/Los_Angeles 

then export the TZ variable

$ export TZ=America/Los_Angeles
$ date


Method 3: Command line tools.

Using below interactive method also we can change the Time zone

Ubuntu: dpkg-reconfigure tzdata
Redhat: redhat-config-date
CentOS/Fedora: system-config-date
FreeBSD/Slackware: tzselect



Post a Comment

21 Comments

  1. As for me, I thought, that the process will be easier and I will not need to type any codes. Maybe, I will ask my friend for help.

    ReplyDelete
  2. You have done excellent job Thanks a lot and I enjoyed your blog. Great Post.
    Data Science Certification in Hyderabad

    ReplyDelete
  3. Great post happy to see this. I thought this was a pretty interesting read when it comes to this topic Information. Thanks..
    Artificial Intelligence Course

    ReplyDelete
  4. Nice Post thank you very much for sharing such a useful information and will definitely saved and revisit your site and i have bookmarked to check out new things frm your post.
    Data Science Course

    ReplyDelete
  5. Thanks Your post is so cool and this is an extraordinary moving article and If it's not too much trouble share more like that.
    Digital Marketing Course in Hyderabad

    ReplyDelete
  6. Informative Post. The information you have posted is very useful and sites you have referred was good. Thanks for sharing.
    Data Science Course with Placement

    ReplyDelete
  7. Excellent effort to make this blog more wonderful and informative. The information shared was very useful.
    Cloud Computing Course Fees in Bangalore

    ReplyDelete
  8. Actually I read it yesterday but I had some ideas about it and today I wanted to read it again because it is so well written.
    Data Scientist Course in Jaipur

    ReplyDelete
  9. You have done a great job and will definitely dig it and personally recommend to my friends. Thank You.
    Data Science Online Training

    ReplyDelete
  10. Very good message. I stumbled across your blog and wanted to say that I really enjoyed reading your articles. Anyway, I will subscribe to your feed and hope you post again soon.
    Data Scientist Course in India

    ReplyDelete
  11. Very good article and liked reading your post, very pleasant to share, I want to tweet this to my followers. Thank you!.
    Best Digital Marketing Institute in Hyderabad

    ReplyDelete
  12. A good blog always contains new and exciting information and as I read it I felt that this blog really has all of these qualities that make a blog.
    Data Science Institutes in Bangalore

    ReplyDelete
  13. You have done excellent job Thanks a lot and I enjoyed your blog. Great Post.
    Ethical Hacking Course in Hyderabad

    ReplyDelete
  14. I really enjoyed reading this post and keep up the good work and let me know when you can post more articles or where I can find out more on the topic.
    Data Science Online Course

    ReplyDelete
  15. Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. keep up the good work.
    Mlops Training

    ReplyDelete
  16. Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
    Mlops Course

    ReplyDelete
  17. Really nice and amazing post. I was looking for this kind of information, Keep posting. Thanks for sharing.
    Data Science Courses in Bangalore

    ReplyDelete
  18. I read your excellent blog post. It's a great job. I enjoyed reading your post for the first time, thank you.
    Data Science Institutes in Bangalore

    ReplyDelete
  19. This is definitely one of my favorite blogs. Every post published did impress me.
    Data Science Course in Indore

    ReplyDelete

  20. I want to thank you for your efforts in writing this article. The information provided was very useful.
    Data Science Certification Bangalore

    ReplyDelete
  21. Thank you for sharing this wonderful blog, I read that Post and got it fine and informative. Please share more like that...
    Business Analytics Course in Amritsar

    ReplyDelete