Forum: Ruby on Rails Time issues

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
pb p. (Guest)
on 2009-05-17 20:20
OK,

so I have a model that contains 2 records, among others
startdate :time
enddate :time

I have one set of values in the database
20:00:00 for startdate and the same for enddate

However, I have no clue how to add 90 minutes to enddate, relative to
startdate.

Event though the datase has 20:00:00 only, I get inside my view
something like Sun May 17 18:00:00 +0300 2009 and I cannot get it to add
90 minutes to display Sun May 17 19:30:00 +0300 2009

I tried with advance method, but only :days, :years etc works... :hours,
:minutes don't change anything...
pb p. (Guest)
on 2009-05-17 20:21
pb pb wrote:
> OK,
>
> so I have a model that contains 2 records, among others
> startdate :time
> enddate :time
>
> I have one set of values in the database
> 20:00:00 for startdate and the same for enddate
>
> However, I have no clue how to add 90 minutes to enddate, relative to
> startdate.
>
> Event though the datase has 20:00:00 only, I get inside my view
> something like Sun May 17 18:00:00 +0300 2009 and I cannot get it to add
> 90 minutes to display Sun May 17 19:30:00 +0300 2009
>
> I tried with advance method, but only :days, :years etc works... :hours,
> :minutes don't change anything...

never mind, it seems that @myobject.starttime + 90.minutes did the trick
:))
This topic is locked and can not be replied to.