From: Srikanth Jeeva Date: 2008-12-10T22:32:18+09:00 Subject: Re: want only the working hours(9am-5pm) between two dates Brian Candler wrote: > Srikanth Jeeva wrote: >> but i need the total hours between 9am-5pm, between the given dates.. >> can any one plz help?? > > Not sure what you mean. Do you mean (date2 - date1 + 1) * 8 ? > > Use to_i on the answer if you don't want Rational arithmetic. hi brain, i mean.. date1="November 5th, 2008, 10:30 am" date2="November 7th, 2008, 6:00 pm" i want only the working hours between 10:30 am to 6.00 pm,in these dates... date can also be, date1="March 5th, 2005, 5:30 am" date2="November 7th, 2006, 9:00 pm" all i need is working hours between these dates... first day & last days time makes complications here. -- Posted via http://www.ruby-forum.com/.