From https://stackoverflow.com/questions/13497500/retrieve-file-creation-or-modification-date
func fileModificationDate(url: URL) -> Date? { do { let attr = try FileManager.default.attributesOfItem(atPath: url.path) return attr[FileAttributeKey.modificationDate] as? Date } catch { return nil } }