LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-17-2007, 11:24 AM   #1
stinkytofoo
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu
Posts: 14

Rep: Reputation: 0
how to display the current time at a different timezone


Hi all,

I'm in need of a cli application that can display the current time at a specified timezone.
I thought 'date' should be able to do the job, but I was surprised to learn that I was wrong (or was I?)
 
Old 07-17-2007, 11:39 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,522

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
With some hints, date can do it:
Code:
$ TZ=CET date; TZ=UTC date; TZ=Hongkong date; TZ=Montreal date
Tue Jul 17 17:38:25 CEST 2007
Tue Jul 17 15:38:25 UTC 2007
Tue Jul 17 23:38:25 HKT 2007
Tue Jul 17 15:38:25 Montreal 2007
 
Old 07-17-2007, 11:53 AM   #3
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
Good news:
Code:
[yves@server ~]$ date
mar jui 17 17:51:30 CEST 2007
[yves@server ~]$ TZ=GMT-5 date
mar jui 17 20:52:46 GMT 2007
Yves.
 
Old 07-18-2007, 04:41 AM   #4
stinkytofoo
LQ Newbie
 
Registered: Apr 2006
Distribution: Ubuntu
Posts: 14

Original Poster
Rep: Reputation: 0
That's great, thank you both!
 
  


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
question about setting the timezone and time willyweedle Linux - Newbie 1 03-30-2007 12:12 PM
TimeZone change doesn't effect current process cruiserfriend Linux - Software 4 01-17-2006 04:27 AM
System time won't accept new timezone mustangfanatic01 Slackware 4 11-22-2005 08:34 PM
default Timezone display sailu_mvn Fedora 1 03-28-2005 03:36 AM
setting the correct time & timezone from kde? Jelle Debian 8 07-03-2004 11:08 AM


All times are GMT -5. The time now is 02:55 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration