[LRUG] Finding the duration between two DateTimes

Murray Steele murray.steele at gmail.com
Tue May 29 07:51:13 PDT 2007


On 29/05/07, Piers Cawley <pdcawley at bofh.org.uk> wrote:
>
> On 28/05/07, Eleanor <eleanor at goth-chic.org> wrote:
> > Then where you currently create your duration you could write:
> >
> >         duration = Duration.new(Task.duration)
> >
> > However from the perspective of a Task object you may not need any of
> > this complexity. Just because something can be made into an object
> > doesn't necessarily mean that it should...
>
> However, in the case of calendrical calculations, reifying a duration
> makes a great deal of sense. Representing a duration internally as a
> number of seconds makes a great deal less sense though. Consider the
> problems inherent in 1.month, daylight savings, leap years, leap
> seconds and the whole jujuflop situation that is timezones.


Or maybe this: http://rubyforge.org/projects/duration/

Not that I have any experience with this, it could be awful.  However, it
seems like it might be the cure for phantom TimeSpan syndrome.

Muz

_______________________________________________

chat mailing list
> chat at lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20070529/513a959f/attachment-0003.html>


More information about the Chat mailing list