Skip to content

Instantly share code, notes, and snippets.

@Ben-G
Created March 23, 2017 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ben-G/b7b000caf3091da1c3d063019be0a3f1 to your computer and use it in GitHub Desktop.
Save Ben-G/b7b000caf3091da1c3d063019be0a3f1 to your computer and use it in GitHub Desktop.
Date Equality Swift
extension Date {
public static func ==(lhs: Date, rhs: Date) -> Bool {
return lhs.timeIntervalSinceReferenceDate == rhs.timeIntervalSinceReferenceDate ||
lhs.timeIntervalSince1970 == rhs.timeIntervalSince1970
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment