LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-26-2014, 08:54 AM   #1
hksconsulting
LQ Newbie
 
Registered: Mar 2014
Posts: 2

Rep: Reputation: Disabled
Date - change from UTC to another TZ


Hi All,

for some reason my test linux box is only outputing the UTC when I run the "date" command. I confirmed that it has the Selected TIMEZONE and when I run other sub commands I do see the TZ but I cannot get "date" to show the desired TZ.

~# date
Wed Mar 26 12:44:07 UTC 2014

I wan it to display

~# date
Wed Mar 26 5:44:07 PST 2014

__

Looking for help understanding how to fix this.

Thanks
 
Old 03-26-2014, 12:02 PM   #2
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,158
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Welcome to LQ!

Since you didn't specify the OS, you get several answers (bonus!)

To change the hosts' TZ on Ubuntu: open a terminal and issue:
Code:
sudo dpkg-reconfigure tzdata
To change the hosts' TZ on CentOS

Bash Shell only:
Code:
export TZ=America/Los_Angeles ; date
for permanence in bash shell add this to your .bashrc
Code:
export TZ=America/Los_Angeles
This will not change the system TZ.

and re-source it using
Code:
source ~/.bashrc
for temporary date manipulation you can use:
Code:
TZ=PST8PDT date
in a bash shell.

Hope that helps!

Last edited by Habitual; 03-26-2014 at 12:05 PM.
 
1 members found this post helpful.
Old 03-27-2014, 03:32 AM   #3
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 273Reputation: 273Reputation: 273
welcome to LQ!
You can also try with option 1 or 2:

1) tzselect comand
2) ln -s /usr/share/zoneinfo/your_country/your_city /etc/localtime
 
Old 03-27-2014, 08:24 AM   #4
hksconsulting
LQ Newbie
 
Registered: Mar 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
Welcome to LQ!
To change the hosts' TZ on Ubuntu: open a terminal and issue:
Code:
sudo dpkg-reconfigure tzdata
Hope that helps!
I tried you listed commands and this one had remained permanently after reboot. Thanks for your help.
 
Old 03-28-2014, 11:15 AM   #5
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,158
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
You are very welcome.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I don't understand why log timestamps are UTC but date command is local time Rogue45 Linux - Newbie 5 07-19-2013 04:39 PM
'date' always shows utc ! premnarayan Linux - Newbie 5 04-10-2013 09:41 PM
[SOLVED] date: want to change UTC to local in the displayed system time. stf92 Linux - Newbie 3 11-16-2012 01:23 AM
how do I show date in daylight savings time not utc Glenn D. Programming 2 11-21-2009 07:55 AM
Why does date always display utc? cmnorton Ubuntu 2 05-23-2008 11:01 AM


All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration