Philip Hallstrom wrote in post #937228:

Just for the sake of argument... how about the time it takes runners to
finish a marathon? Sure you could use seconds as an integer field, but
time without date make sense...
I'm currently developing application, where I need to store beginning
date (date only, without time) and amount of time passed.

I found a gem, that deals with 'time without date' issue:
https://github.com/lailsonbm/time_of_day

It can be useful in some cases.

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • KlausG at Oct 26, 2012 at 2:59 pm

    Am Dienstag, 31. August 2010 23:12:51 UTC+2 schrieb Philip:
    Just for the sake of argument... how about the time it takes runners to
    finish a marathon? Sure you could use seconds as an integer field, but
    time without date make sense...

    I agree that "4pm" is kind of pointless, but "16 hours" can be handy.

    If only to save me from having to convert from seconds to hh:mm:ss and
    back, etc...

    -philip
    So we have to differentiate between
    - "Time" which means Point of Time in a specific day, and
    - "Duration" which means the difference between two Points in Time

    Is there a "Duration" gem for RoR ?

    --
    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 rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/-8Y1pxABBnAJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Zhi-Qiang Lei at Oct 26, 2012 at 3:26 pm
    Yes, check ActiveSupport, RoR has it.
    On Oct 26, 2012, at 10:34 PM, KlausG wrote:

    Am Dienstag, 31. August 2010 23:12:51 UTC+2 schrieb Philip:
    Just for the sake of argument... how about the time it takes runners to finish a marathon? Sure you could use seconds as an integer field, but time without date make sense...

    I agree that "4pm" is kind of pointless, but "16 hours" can be handy.

    If only to save me from having to convert from seconds to hh:mm:ss and back, etc...

    -philip

    So we have to differentiate between
    - "Time" which means Point of Time in a specific day, and
    - "Duration" which means the difference between two Points in Time

    Is there a "Duration" gem for RoR ?

    --
    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 rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/-8Y1pxABBnAJ.
    For more options, visit https://groups.google.com/groups/opt_out.

    Best regards,
    Zhi-Qiang Lei
    zhiqiang.lei@gmail.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 rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 26, '12 at 7:43a
activeOct 26, '12 at 3:26p
posts3
users3
websiterubyonrails.org
irc#RubyOnRails

3 users in discussion

KlausG: 1 post Denis P.: 1 post Zhi-Qiang Lei: 1 post

People

Translate

site design / logo © 2021 Grokbase