Why are you adding hours to a Date in the first place? I don't understand. Does that make it the next day or the same day 2 hours past the start of the day in whatever timezone you are in, intuitively?
I vote: b. Bug. #= should compare calendar (gregorian, julian etc,), year, month, day or year, day # of year On Feb 1, 2014, at 12:26 PM, Sven Van Caekenberghe <sven@> wrote: > Sebastian, > > In my 3.0 image > > | today | > today := Date today. > (today translateTo: 2 hours) = today. > > => false > Yeah, here too > But what are you trying to accomplish ? Detect the most simple equality in the most conventional way. A true when two dates refers to the same date of the calendar > Dates are a bit ambiguous: my Feb 1st and your Feb 1st, in one sense they > are the same, refer to the same date, but in another sense, yours started > at a different point in time, right ? So are they equal ? Well dates are the same, that’s the convention isn’t it? Localisation and time is what's different there. If you want to have time involved in the equation the logic step given our options is that you use DateAndTime So, again… Is this a bug or a feature? 1. Feature: our convention is injecting time in dates so we are injecting an incompatibility with intuition in exchange of a surprising precision* 2. Bug: Date #= should not compare start *a precision that is redundant because DateAndTime also have the #translateTo: feature > Sven > > On 01 Feb 2014, at 14:01, Sebastian Sastre <sebastian@> wrote: > >> Can somebody please clarify if this is a bug or feature? >> >> thanks >> >> >> >> >> On Jan 31, 2014, at 9:03 PM, Sebastian Sastre <SEBASTIAN@> wrote: >> >>> self assert: Date today = Date today. >>> >>> today := Date today translateTo: 2 hours. >>> self assert: today = Date today >>> >>> Is this right? >>> >>> >>> >>> >> >> > > -- View this message in context: http://forum.world.st/Comparing-dates-tp4740789p4741022.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
