Why are you parsing if you have all the data?

Just create a Time object with your parameters. Please read the docs
-> http://www.ruby-doc.org/core/classes/Time.html

-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)



On Tue, Feb 24, 2009 at 5:06 AM, Sunny Bogawat
<[email protected]> wrote:
>
> I am using Time.parse for creating time object like
> start_date =
> Time.parse("#{event.from_year.to_s}-#{event.from_month.to_s}-#{event.from_day.to_s}
> #{event.from_time.to_s}")
>
>  end_date =
> Time.parse("#{event.to_year.to_s}-#{event.to_month.to_s}-#{event.to_day.to_s}
> #{event.to_time.to_s}")
>
> But when i pass input year to this as 1993 then after parsing it give me
> result
> 2001-01-02 20:00:00 like this? why not it give me year as a 1993?
>
> please help me to find solution.
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to