[wtr-general] Re: Adding Date

2008-11-17 Thread Alan Baird
Sunil - You want the Time class which is one of Ruby's core classes (see http://www.ruby-doc.org/core/ http://www.ruby-doc.org/core/look for the Time class). Here are some examples that may help: irb(main):014:0 require 'time' = true irb(main):016:0 t = Time.parse(30-11-2008) = Sun Nov 30

[wtr-general] Re: Adding Date

2008-11-17 Thread Sunil Philip
Thanks for the solution Alan. I also got 2 other methods which are given below: Method 1: require 'date' temp = Date::today+1 puts(temp.strftime(%d-%b-%Y).upcase) Method 2: (I got it from this group itself) require 'date' #Date Add Function def date_add(mth,day,yr) #Set Date Variable

[wtr-general] Re: Adding Date

2008-11-17 Thread Paul Rogers
I think watir now includes active support ( and if it doesnt its easy to add it anyway) then you can do things like this: irb(main):001:0 require 'date' = true irb(main):002:0 require 'activesupport' = true irb(main):003:0 Date.today + 2.days = Wed, 19 Nov 2008 Paul On Mon, Nov 17, 2008 at