<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-27 1:21 GMT+02:00 Sean P. DeNigris <span dir="ltr">&lt;<a href="mailto:sean@clipperadams.com" target="_blank">sean@clipperadams.com</a>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">David T. Lewis wrote<br>
<div class="">&gt; the two main responsibilities of DateAndTime. One is<br>
&gt; to represent time as a magnitude (for duration calculation, etc). The<br>
&gt; other<br>
&gt; is to display time in the frame of reference of a local time zone. It is<br>
&gt; not<br>
&gt; at all clear to me that those two responsibilies belong in the same class.<br>
<br>
</div>There is definitely something fishy with the combination. Consider Pharo&#39;s<br>
Date, which retroactively applies the current timezone to dates. This is bad<br>
because e.g.:<br>
  &#39;7/10/2014&#39; asDate &quot;evaluated the day before DST&quot; ~= &#39;7/10/2014&#39; asDate<br>
&quot;evaluated the day after DST&quot;<br>
<br>
I created an issue, which has been sitting on the bug tracker. Here&#39;s an<br>
excerpt from the discussion<br>
(<a href="https://pharo.fogbugz.com/default.asp?12147#BugEvent.90264" target="_blank">https://pharo.fogbugz.com/default.asp?12147#BugEvent.90264</a>):<br>
<br></blockquote><div><br></div><div>For me, this is definitely a bug.<br></div><div>In current implementation, the date corresponding to a DST change should be either 23h or 25h long,<br>and this should not depend on active DST at the time you ask.<br>
<br></div><div>Of course, if we go into these complications, what to do when the DST rules change, but we ask for a Date anterior to the change?<br></div><div>Shall we store/maintain the DST rule history for each and every part of the world?<br>
<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; I see that a particular location could reasonably be implied in a Date,<br>
&gt; e.g. if we&#39;re saying that a treaty was signed on such and such a date, we<br>
&gt; mean at the place where it was signed... it may have already been the next<br>
&gt; day in another time zone.<br>
&gt;<br>
&gt; Now, what is beyond doubt, is that the timezone that would be implied is<br>
&gt; the timezone of the date itself, not an artifact of when the instance was<br>
&gt; created. In my example, I create &#39;11/12/2013&#39; asDate, and it assumes my<br>
&gt; timezone.<br>
&gt; Since it&#39;s the summer in NY, that means -4 offset. Now, I evaluate<br>
&gt; &#39;11/12/2013&#39; asDate again in December. Again it implies my timezone, the<br>
&gt; offset of which has changed to -5! So now &#39;11/12/2013&#39; asDate (in NY) ~=<br>
&gt; &#39;11/12/2013&#39; asDate (in NY). Even though the offset of the date in<br>
&gt; question, which depends only on whether DST was in effect on 11/12/2013,<br>
&gt; has not changed.<br>
&gt;<br>
&gt; So the current behavior of two equal dates being considered not-equal is<br>
&gt; as jarring as your counter example of two non-equal dates (different<br>
&gt; timezone) being considered equal.<br>
<br>
There doesn&#39;t seem to be an easy, direct solution because I&#39;m assuming we<br>
don&#39;t have a primitive for &quot;the offset at this location on X date in the<br>
past&quot;. So the next best thing might be a PlatonicDate (obviously a<br>
name-in-progress :)) that represents the abstract idea of a Date without<br>
regard to location, and then an object to connect a particular place/offset<br>
to that concept (but the second one would have the same problem as we<br>
currently have).<br>
<br>
<br></blockquote><div><br><div>Of course, a PlatonicDate would be so much simpler...<br></div><div>It&#39;s a different thing though.<br></div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
-----<br>
Cheers,<br>
Sean<br>
--<br>
View this message in context: <a href="http://forum.world.st/What-s-up-on-build-squeak-org-tp4760266p4774978.html" target="_blank">http://forum.world.st/What-s-up-on-build-squeak-org-tp4760266p4774978.html</a><br>
Sent from the Squeak - Dev mailing list archive at Nabble.com.<br>
<br>
</blockquote></div><br></div></div>