Last active
November 30, 2017 16:38
-
-
Save jazzedge/95e96a6a4ce2753405e55ecc6ca64f2e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** Return the difrence of 2 dates in minutes | |
| - parameter fromDate: The first date for the comparison | |
| - parameter toDate: The second date for the comparison | |
| */ | |
| func dateDiffInMinutes(_ fromDate: Date, toDate: Date) -> Int { | |
| return (Calendar.current as NSCalendar).components(.minute, from: fromDate, to: toDate, options: NSCalendar.Options(rawValue: 0)).minute! | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment