LinuxQuestions.org
Register a domain and help support LQ
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-07-2010, 04:12 AM   #1
elainelaw
Member
 
Registered: Jan 2008
Posts: 258

Rep: Reputation: 30
system time


I know the command "date" can show the current server date and time with local time zone , can advise if I want to show a date and time with a specific time zone , what can i do ?

for example , if current server time zone is BST , I want to show the time with GMT time zone , what can i do ? thx
 
Old 04-07-2010, 04:16 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Since you seem to be posting a fair bit I'd start with the
basics - learn how to use the abundant information that
came with your installation of Linux.
Code:
info coreutils date

Last edited by Tinkster; 04-07-2010 at 04:17 AM.
 
Old 04-07-2010, 05:58 AM   #3
elainelaw
Member
 
Registered: Jan 2008
Posts: 258

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Tinkster View Post
Since you seem to be posting a fair bit I'd start with the
basics - learn how to use the abundant information that
came with your installation of Linux.
Code:
info coreutils date
thx reply,

I don't want to change the server time zone , I just want to change the display of time zone , this is for some programming use only , can advise what can i do ? thx
 
Old 04-07-2010, 06:21 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

You can use the TZ variable for that like below:
Code:
TZ='Europe/Madrid'
export TZ
date
in that order will give you the time and date currently in Spain (CEST - Central Europe Summer Time). Changing the TZ to another one will change the displayed time. You can find out what to use by running tzselect (works on Debian and RHEL5, not sure for other distro).

You can also show UTC date/time like this:
Code:
date -u
Kind regards,

Eric
 
Old 04-07-2010, 06:34 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,834

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
Quote:
Originally Posted by elainelaw View Post
I don't want to change the server time zone , I just want to change the display of time zone , this is for some programming use only , can advise what can i do ? thx
Tink already advised you what to do. How about you show the courtesy of trying. If you are not prepared to accept answer[s] offered, don't bother asking.
 
  


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
System time vs Hardware time and Daylight Savings Time Toadman Linux - General 6 03-17-2007 09:12 AM
System time vs Hardware time and Daylight Savings Time Toadman Linux - Networking 6 03-16-2007 08:14 PM
Where does RH8 daily set system time to hardware clock time smartnorman Red Hat 1 05-24-2006 03:42 PM
Setting System Time: kernel in wrong time zone warrenweiss Linux - General 7 05-15-2004 04:25 PM


All times are GMT -5. The time now is 10:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration