Swift 日期扩展:SwiftDateExtension
jopen
10年前
SwiftDateExtension 是 Swift 日期扩展。
简单示例://-- Adding time units: let date1: NSDate = NSDate().plusMonths(2).minusDays(5).plusSeconds(5) let date2: NSDate = NSDate().plusYears(1).minusMonths(6) //-- Calculating difference between dates: let weeksBetween = NSDate.monthsBetween(date1: someDate, date2: someOtherDate) let monthsBetween = NSDate.weeksBetween(date1: someDate, date2: someOtherDate)