LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 04-09-2009, 03:08 AM   #1
nagendrar
Member
 
Registered: Apr 2008
Location: HYD, INDIA.
Posts: 154

Rep: Reputation: 15
Is there any command to know Offset using TimeZone


Is there any command to know Offset using TimeZone.

For ex Let us take TimeZone as EST.How can we find the offset using this time zone.

Thanks,
Nagendra.
 
Old 04-09-2009, 03:22 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Code:
TZ=EST date +%z
From the date man page:
Code:
TZ     Specifies the timezone, unless overridden by command line parameters.
       If neither  is  specified,  the setting from /etc/localtime is used.
 
Old 04-09-2009, 03:46 AM   #3
nagendrar
Member
 
Registered: Apr 2008
Location: HYD, INDIA.
Posts: 154

Original Poster
Rep: Reputation: 15
But when I entered the command

TZ=IST date +%z

Then I got +0000 instead of +530

Thanks,
Nagendra.
 
Old 04-09-2009, 03:57 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
IST is not a valid timezone. Check under /usr/share/zoneinfo for available timezone names. Sometimes you have to specify the long name of a timezone. For example if IST equals Europe/Dublin:
Code:
$ TZ=Europe/Dublin date +%z
 
  


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
my monitor is offset kenan6346 Linux - Newbie 8 05-05-2008 03:34 AM
register offset? ashlesha Programming 2 07-28-2006 05:49 PM
offset on lm-sensor? bobbens Linux - Hardware 3 01-20-2005 03:34 PM
Download-Offset possible? Cornholio Linux - Software 0 01-10-2005 03:47 AM
monitor offset moschi Linux - Newbie 3 04-18-2004 11:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:08 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
Open Source Consulting | Domain Registration