[squeak-dev] DirectoryEntryFile>>modificationTime (etc) UTC handling broken

tim Rowledge tim at rowledge.org
Sun Nov 8 18:58:13 UTC 2020


Something has broken wrt the handling of the DirectoryEntryFile conversion of the file times.

If you open a FileList of some format and look at files you will see the date/time info shown correctly. At least, on Mac & linux; no idea about Windows.

If you inspect
   FileDirectory default directoryEntryFor: 'somefileIjustmade.foo'
and then in the inspector try 
   self modificationDateAndTime
you will notice that the date is borked. 

Compare and contrast with 
  date fromSeconds: modificationTime
and
   Time fromSeconds: modificationTime \\ 86400

The issue seems to stem from a confusion about the expected value of the modificationTime. The image code is assuming it is a UTC seconds count and includes the image's known TZ offset to cause the (in my case) 8 hour variance. The VM code (modulo what version I currently have loaded etc etc) is making a TZ (plus Squeak epoch) corrected value from the number provided by the OS call used.

As best I can tell from the versions record some substantial changes got made to the DateAndTime>>fromSeconds: in 2018 so it may have been problematic ever since then.

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.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful random insult:- The wheel's spinning but the hamster's dead.




More information about the Squeak-dev mailing list