From: "R.. Kumar 1.9.1 OSX" Date: 2010-08-21T03:09:20+09:00 Subject: Re: Dealing with dates & timezones > > tz = TZInfo::Timezone.get(Choice.choices[:from]) > tz1 = TZInfo::Timezone.get('Asia/Calcutta') > #local = tz.utc_to_local(Time.utc(2008,9,4,14,00,0)) > unparsed.each {|timestr| > puts timestr [1] > local = tz.local_to_utc(Time.parse(timestr)) > puts tz1.utc_to_local(local) [2] > } > (you would not need to loop. unparsed refers to ARGV on command line) Please note in the above program, i am always converting incoming time to time in Asia/Calcutta. However, the incoming time (time "from" can be passed on the command line). tz is time_zone from tz1 is time_zone to (calcutta) [1] is what the user entered such as "12:00 AM" [2] is converted time in Asia/Cal. I hope this helps. -- Posted via http://www.ruby-forum.com/.