Date.parse does not work anymore

i am sure i have used date.parse in my code. however it does not work
anymore. i also tried to change the string format but it did not help.
any assistance is appreciated.

irb(main):022:0> Date.parse(“2006-01-02”)
NoMethodError: undefined method parse' for Date:Class from (irb):22 irb(main):023:0> Date.parse("03/28/2008") NoMethodError: undefined methodparse’ for Date:Class
from (irb):23
irb(main):024:0> Date.parse(“28/3/2008”)
NoMethodError: undefined method parse' for Date:Class from (irb):24 irb(main):025:0> Date.strptime('28/03/2008', '%d/%m/%Y') NoMethodError: undefined methodstrptime’ for Date:Class
from (irb):25
irb(main):026:0>

On Thursday 14 August 2008, Junkone wrote:

irb(main):024:0> Date.parse(“28/3/2008”)
NoMethodError: undefined method parse' for Date:Class from (irb):24 irb(main):025:0> Date.strptime('28/03/2008', '%d/%m/%Y') NoMethodError: undefined methodstrptime’ for Date:Class
from (irb):25
irb(main):026:0>

require ‘date’

Stefano

El Jueves, 14 de Agosto de 2008, Junkone
escribió:> irb(main):024:0> Date.parse(“28/3/2008”)

NoMethodError: undefined method parse' for Date:Class from (irb):24 irb(main):025:0> Date.strptime('28/03/2008', '%d/%m/%Y') NoMethodError: undefined methodstrptime’ for Date:Class
from (irb):25
irb(main):026:0>

Don’t ask me way, but you must load “date.rb” library instead of
“time.rb”
library.
Both contain “Date” class but just “date.rb” contains that method.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs