Skip to content

Instantly share code, notes, and snippets.

@jpotts18
Created October 24, 2014 18:26
Show Gist options
  • Save jpotts18/cef15123c18f6d0bac65 to your computer and use it in GitHub Desktop.
Save jpotts18/cef15123c18f6d0bac65 to your computer and use it in GitHub Desktop.
Reopening classes
extension Int {
var days: NSTimeInterval {
let DAY_IN_SECONDS = 60 * 60 * 24
var days:Double = Double(DAY_IN_SECONDS) * Double(self)
return days
}
}
let date = NSDate()
let twoDaysAgo = NSDate(timeInterval: -3.days, sinceDate: date)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment