Menu

#37 Datetime-related problems in saved scan data

unknown
closed
nobody
None
1
2016-06-11
2016-02-03
No

I have encountered the following issues with the datetime strings used in saved scan XML data. I have fixed them in my fork; see this commit.

  • For writing created, modified, accessed, attributes on File and Folder elements, you are using an en_GB-locale CFDateFormatter, but it appears that the format output by this locale is not stable across OS X versions: On OS X 10.11 I get dd/MM/yyyy, HH:mm but on OS X 10.10 I get dd/MM/yyyy HH:mm (note comma). This means scan data created on one system will fail to be parsed on another system.
  • For writing the scanTime attribute on ScanInfo you are using NSDate description; this is problematic because:
    • That property is only intended for debugging
    • The method you use to parse it back is deprecated
    • It's inconsistent with other datetime strings in the XML
  • The datetime strings (except scanTime) do not contain time zone information, so the parse results will be inconsistent depending on the system time zone

My patch fixes the above problems by using RFC 3339 format datetime strings (yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'). Parsing retaining backwards compatibility by attempting to read old formats. I have bumped the format version to 5.

Discussion

  • Erwin Bonsma

    Erwin Bonsma - 2016-03-28
    • status: open --> closed
     
  • Erwin Bonsma

    Erwin Bonsma - 2016-03-28

    Fix has been merged in. Will appear in next release

     

Anonymous
Anonymous

Add attachments
Cancel