<div dir="ltr"><div dir="ltr">Hi Alistair,</div><div dir="ltr"><br><div>which version of Squeak are you using?  The latest version I get</div><div> {true . false . 2018-10-17T00:00:00-07:00 . 1:00:00:00 . 2018-10-17T00:00:00+00:00 . 1:00:00:00}<br></div><div>from the results of your script.  Maybe you are using Pharo?  Back in Feb 2016 the default offset for timespans (and hence the default offset for Date) was set to nil - meaning for the display the Date today should show +0:00 (which is not nil, obviously, but prints better).</div><div><br></div><div>-Chris<br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 17, 2018 at 8:21 AM Alistair Grant <<a href="mailto:akgrant0710@gmail.com">akgrant0710@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Chris,<br>
<br>
On Wed, 17 Oct 2018 at 16:36, Chris Cunningham <<a href="mailto:cunningham.cb@gmail.com" target="_blank">cunningham.cb@gmail.com</a>> wrote:<br>
><br>
> Hi.<br>
><br>
> Following a thread in Pharo where two dates that are equal weren't usable in a Dictionary as keys, I wondered if the same thing is true in Squeak.  It is, unfortunately.  I can't use the same code as given in the Pharo example (we don't have a #translateToUTC), but equivalent code shows the issue:<br>
><br>
> d1 := DateAndTime now asDate.<br>
> d2 := Date today.<br>
> d1 = d2. "true"<br>
> d1 hash = d2 hash. "false"<br>
><br>
> I'll get around to fixing the hash in the next day or so, when I get a chance to figure out how.<br>
<br>
I get true for both comparisons.<br>
<br>
What's the result of:<br>
<br>
| d1 d2 |<br>
<br>
d1 := DateAndTime now asDate.<br>
d2 := Date today.<br>
{<br>
d1 = d2.<br>
d1 hash = d2 hash.<br>
d1 start.<br>
d1 duration.<br>
d2 start.<br>
d2 duration. }<br>
<br>
" an Array(<br>
true<br>
true<br>
2018-10-17T00:00:00+02:00<br>
1:00:00:00<br>
2018-10-17T00:00:00+02:00<br>
1:00:00:00)"<br>
<br>
Cheers,<br>
Alistair<br>
<br>
</blockquote></div>