Forum: Ruby on Rails How to create date obj?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
3548d30217e9921c410db19ce8ce38d0?d=identicon&s=25 Sunny Bogawat (sunny_bogawat)
on 2009-02-06 10:42

 In one of my application i have to create a date obj like 2009-02-05
   but for this i have following input which is integer.
  form_day = 05, from_month = 02 from_year= 2009 and from_time=12:00:00

    Please  suggest a best solution for it?
3131fcea0a711e5ad89c8d49cc9253b4?d=identicon&s=25 Julian Leviston (Guest)
on 2009-02-06 15:21
(Received via mailing list)
Look up the date class in the prag prog's book. It explains how to
create dates.,12,30) for example.

Learn rails:

On 06/02/2009, at 8:42 PM, Sunny Bogawat
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-02-06 15:51
(Received via mailing list)
try it like this:
  date = DateTime.civil(y=from_year, m=from_month, d=from_month,
min=from_time.min, s=from_time.sec, of=0)

here is the according ruby-api:
This topic is locked and can not be replied to.