irb(main):001:0> time = Time.now.strftime("%d-%m-%Y")
=> "05-10-2005"
Haven't tried with year as "yyy" though. Did you mean "yyyy"? That is %Y
(year with century). The two digit (year with no century) is %y.
This page should help: http://phrogz.net/ProgrammingRuby/ref_c_time.html
Look up "strftime" for formatting.
-Jonathan
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of beth ferguson
> Sent: October 5, 2005 6:25 PM
> To: [email protected]
> Subject: [Wtr-general] get date, increment date functionality
>
> Hello All--
>
> I'm trying to fill a form which has a series of default date
> values ( call it-- get_next_monday x 4 ) which is used to
> populate the option items in a select list. For this value I
> can use something like
> $ie.select_list(:name, 'onAirDate').select_value(/1/).
>
> But I need to also select a deleteDate which must be at
> least 1 day and as many as 14 days from my "onAirDate"
> selection. I found (Date.today) which returns the date in a
> yyyy-mm-dd, but i can't seem to locate any methods which will
> allow me to format the date ( i need dd-mm-yyy) or to
> increment the date.
>
> Thanks-
>
> Beth
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general