Skip to content

Instantly share code, notes, and snippets.

@Xinguang
Created July 31, 2015 14:55
Show Gist options
  • Save Xinguang/ff4add265834385faed0 to your computer and use it in GitHub Desktop.
Save Xinguang/ff4add265834385faed0 to your computer and use it in GitHub Desktop.
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