<div dir="ltr"><div>Apparently I use this, but not where I run into it every day.</div><div><br></div><div>And there are test to make sure #asLocal works - but they involve having aDateAndTime set, then comparing aDateAndTime asLocal = aDateAndTime, which obviously works.  Since the previous code actually changed aDateAndTime, the two are identical (as opposed to just equivalent).</div><div><br></div><div>If no one objects, I'll move this into trunk in a couple of days.</div><div><br></div><div>-cbc</div></div><br><div class="gmail_quote"><div class="gmail_attr" dir="ltr">On Tue, May 14, 2019 at 3:33 PM <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">Chris Cunningham uploaded a new version of Chronology-Core to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Chronology-Core-cbc.45.mcz" target="_blank" rel="noreferrer">http://source.squeak.org/inbox/Chronology-Core-cbc.45.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Chronology-Core-cbc.45<br>
Author: cbc<br>
Time: 14 May 2019, 3:33:13.333275 pm<br>
UUID: 4117cd16-a46a-4647-9630-49ee93d3f725<br>
Ancestors: Chronology-Core-nice.44<br>
<br>
With the UTC / DateAndTime changs, DateAndTime>>utcOffset: changed to update the existing instance in place instead of creating a new instance.<br>
The change fixes #asLocal to create a new instance, bypassing #utcOffset:.<br>
Follows the same logic as used in #asUTC<br>
<br>
=============== Diff against Chronology-Core-nice.44 ===============<br>
<br>
Item was changed:<br>
  ----- Method: DateAndTime>>asLocal (in category 'ansi protocol') -----<br>
  asLocal<br>
+       "Anwer a copy of oursielves (if necessary) in the local timezone.  #utcOffset: now modifies my instance, so the creation of the new instance should happen here."<br>
-       <br>
<br>
        ^ (self offset = self class localOffset)<br>
- <br>
                ifTrue: [self]<br>
+               ifFalse: [self copy localOffsetSeconds: self class localOffset asSeconds]!<br>
-               ifFalse: [self utcOffset: self class localOffset]!<br>
<br>
<br>
</blockquote></div>