<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:large">Hi Tim, Hi Dave,<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 8, 2020 at 5:27 PM tim Rowledge <<a href="mailto:tim@rowledge.org">tim@rowledge.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
<br>
> On 2020-11-08, at 4:57 PM, David T. Lewis <<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>> wrote:<br>
> <br>
> On Sun, Nov 08, 2020 at 10:58:13AM -0800, tim Rowledge wrote:<br>
>> Something has broken wrt the handling of the DirectoryEntryFile conversion of the file times.<br>
> <br>
[snip]<br>
>> I'd guess that there ought to be a DateAndTime class>fromLocalSeconds: or similar? Timezones hurt my head so I'm very keen to pass the buck to people with a more direct interest in the chronology stuff. The #creationDateAndTime obviously needs the same solution.<br>
>> <br>
> <br>
> I think you're on the right track here, although I don't think<br>
> we would want to add this directly to DateAndTime. As Chris would<br>
> probably point out, the API is messy enough already.<br>
> <br>
> But somebody has figured out how to make this mess behave reasonably<br>
> in the FileList, so it must be fixable.<br>
<br>
The FileList simply uses the no-idea-about-TZ code and happened to get it right by accident ;-)<br>
<br>
There is actually a fairly simple, though tacky solution.<br>
<br>
<br>
!DirectoryEntry methodsFor: 'access' stamp: 'tpr 11/8/2020 17:18'!<br>
modificationDateAndTime<br>
        "The DateAndTime my entry in the file system was last modified."<br>
        ^ DateAndTime fromSeconds: modificationTime - DateAndTime localOffsetSeconds! !<br>
<br>
Obviously required for creationTimeAndDate too.<br>
<br>
An alternative that would approach from the creation end would be to subtract the localOffsetSeconds in the DirectoryEntry>>#setDirectory:name:creationTime:modificationTime:fileSize: method - but then we'd also have to fix the FileList and all the other senders of #modificationTime & #creationTime to use DateAndTime. Not that we  shouldn't fix those - looking at some of them  I suspect some interesting bugs might have been caused by the errant TZ factor.<br></blockquote><div><br></div><div class="gmail_default">OK, it's done in the latest VM sources.  Make a new VM, set the image header flag via e.g.</div><div class="gmail_default"><br></div><div class="gmail_default">    Smalltalk vmParameterAt: 48 put: ((Smalltalk vmParameterAt: 48) bitOr: 128)</div><div class="gmail_default"><br></div><div class="gmail_default">and now times from both the FilePlugin and the FileAttributesPlugin are in UTC seconds from the epoch.</div><div class="gmail_default"><br></div><div class="gmail_default">Backwards compatibility is maintained.  Images without the bit set will get local times from the File plugins.  Rum the image on an older VM and times will always be local, but the flag bit should be preserved, so is can be saved on an older VM, but when run on the newer, if the flag was set, times should be delivered in UTC.</div><div class="gmail_default" style="font-size:large"><br></div></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div>