Currently browsing category

swift

swift 4 – 國曆轉農曆

let dateAt: String = “2016/1/1” let dateFormatter: DateFormatter = DateFormatter() dateFormatter.dateFormat = “yyyy/MM/dd” let dateComps: NSDateComponents = NSCalendar(calendarIdentifier: NSCalendar.Identifier.chinese)!.components([.year, .month, .day], from: …

swift – 國曆轉農曆

let dateAt: String = “2016/1/1” let dateFormatter: NSDateFormatter = NSDateFormatter() dateFormatter.dateFormat = “yyyy/MM/dd” let dateComps: NSDateComponents = NSCalendar(calendarIdentifier: NSCalendarIdentifierChinese)!.components([.Year, .Month, .Day], fromDate: …