swift开发笔记04
2017-09-08 16:03 dengchaojie_learner 阅读(100) 评论(0) 编辑 收藏 举报let now = Date()
let gregorian = Calendar.init(identifier: Calendar.Identifier.gregorian)
let components = (gregorian as NSCalendar).components(NSCalendar.Unit.year, from: birthdayDP.date, to: now, options: [])
let age = components.year