Tim Mackinnon wrote
> I am also wondering if the issue with Timespan is concerning - I was
> surprised that putting a start and end date left me something that didn’t
> answer my end date presumably down to rounding when it’s converted down to
> a duration (making me wonder if its better to keep a start and end date
> and calculate the duration on the fly).
> 
> Tim


The Timespans are half open intervals.
(https://en.wikipedia.org/wiki/Interval_(mathematics))

Friday July 21st ends at 11:59:59.99999999999... etc etc etc ...9999PM and
the 22nd starts at 12:00AM


If Timespans were closed intervals like you expect then we'd be out of whack
with our corner of the universe.  That extra clock tick adds complexity.  

But I add a method to my image called #displayEnd because I also want them
to print 3PM-4PM and not 3PM-3:59:59.999999999PM and use that in my print
statements and rendering for Seaside.  

displayEnd
        ^ start + duration








--
View this message in context: 
http://forum.world.st/How-to-calculate-someone-s-age-elegantly-Does-Duration-work-tp4955990p4956114.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to