[Rails] Convert Date to Time

Mathias Stjernström mathias at globalinn.se
Wed Mar 1 11:06:57 GMT 2006


Hi,

sql_date = "2006-03-01 11:59:01"

var = Time.local(*ParseDate.parsedate(sql_date))
var.next_week

Cheers!

Mathias Stjernstrom


On Mar 1, 2006, at 11:43 AM, Chris wrote:

> Hi,
>
> How do i convert a Date to a Time??
>
> I have a date returned from sql and i need to be able to use handy
> functions like next_week or beggining of week.
>
> Any help appreciated
> Thanks,
> Chris
>
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails



More information about the Rails mailing list