Skip to content

Instantly share code, notes, and snippets.

@vladimir-anisimov
Created September 1, 2022 06:46
Show Gist options
  • Save vladimir-anisimov/2fa0b3332cbaac8aac54b3274eb0ff29 to your computer and use it in GitHub Desktop.
Save vladimir-anisimov/2fa0b3332cbaac8aac54b3274eb0ff29 to your computer and use it in GitHub Desktop.
extension Date {
static var appInstallDate: Date {
let urlToDocumentsFolder = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last!
let installDate = (try! FileManager.default.attributesOfItem(atPath: urlToDocumentsFolder.path)[FileAttributeKey.creationDate]) as! Date
return installDate
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment