There may be a slicker way to do it, but here's a method I wrote to
solve the same problem.

def dateString(date)

    dateArray = Array.new
    dateArray = date.split('-')
    dateYear = dateArray[0]
    dateMonth = dateArray[1]
    dateDay = dateArray[2]

    date = "#{dateMonth}/#{dateDay}/#{dateYear}"

    return date
end


On Oct 9, 10:08 am, Moochie <[EMAIL PROTECTED]> wrote:
> How can I convert the following dateformate?
>
> puts "2007-12-30".strftime("%m/%d/%Y")
> puts "2007-12-30".to_a.strftime("%m/%d/%Y")
>
> The I've pulled the date from the database, but I want to format as
> 12/30/2007.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to