Register
It is currently Mon Dec 22, 2014 7:00 am

Programming a world clock or at least display a specific TZ


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Sun Oct 01, 2006 3:05 pm   

Joined: Mon Apr 24, 2006 2:39 pm
Posts: 30
Location: Villahermosa
I want to have a command line switcher that will display a specific timezone. So for example it will grab the values from DATE and then substract or add depending on the GMT value.

If I am on Eastern time and I want to display london time (GMT 0) it will do a date - 6. However since I am a n00b at bash I am wondering how to performs things like explode (transform the date value into a number value) and how will the logic be if I need to restart the clock before is less than 0 or more than 12.

I preffer a pm/am than a military clock.


Top
 Profile WWW ICQ YIM  
 PostPosted: Sun Oct 01, 2006 6:38 pm   

Joined: Mon Apr 24, 2006 2:39 pm
Posts: 30
Location: Villahermosa
well it seems I found it without needing major bash scripting. It seems the 'date' commands have enough options to dispay the time from the given timezone.
Code:
date +%r --date='9 hours'


Top
 Profile WWW ICQ YIM  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP