LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-13-2010, 06:24 AM   #1
johnnymta
LQ Newbie
 
Registered: Aug 2009
Posts: 21

Rep: Reputation: 0
Finding the current timezone


Hi guys,
I was wondering if there is a way of knowing what is the current set timezone for a linux server.

I know that "date +%Z" gives the 3 letter abbrevation of the timezone, but then CST can be interpreted as Central Standard Time (US) and as China Standard Time.

I'm looking for a way i could tell what is the real timezone, e.g. "Asia/Jerusalem", "Europe/London", etc.

I know that i can set the timezone by symlinking /usr/share/zoneinfo/<Timezone Name> to /etc/localtime, but when i freshly install CentOS and choose my timezone, /etc/localtime isn't a symlink at all so i can't use this info...

Any ideas?
 
Old 01-13-2010, 06:50 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
You could look in /etc/timezone (if this exists on CentOS). Also check if TZ has been set (echo $TZ).

By doing 'date -R' you can at least view the timezone offset, which may be useful.

Last edited by neonsignal; 01-13-2010 at 06:58 AM.
 
Old 01-13-2010, 06:51 AM   #3
sleddog
Member
 
Registered: Jan 2002
Location: Labrador, Canada
Distribution: CentOS, Debian
Posts: 182

Rep: Reputation: 35
cat /etc/sysconfig/clock ?
 
1 members found this post helpful.
Old 01-14-2010, 02:46 AM   #4
johnnymta
LQ Newbie
 
Registered: Aug 2009
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sleddog View Post
cat /etc/sysconfig/clock ?
YES!!
Thanks a lot
 
  


Reply



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
how to display the current time at a different timezone stinkytofoo Linux - Software 3 07-18-2007 03:41 AM
TimeZone change doesn't effect current process cruiserfriend Linux - Software 4 01-17-2006 03:27 AM
Finding what the current desktop is ashusharma Programming 8 07-15-2004 09:01 AM
finding out the current codec in Mplayer? Kilahchris Linux - Software 2 05-04-2004 01:53 PM
Finding information about the current shell atirya_yodha Linux - Newbie 3 03-18-2004 01:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:13 AM.

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
Open Source Consulting | Domain Registration