This file contains 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
func calculateAge(dob : String) -> (year :Int, month : Int, day : Int){ | |
let df = NSDateFormatter() | |
df.dateFormat = "yyyy-MM-dd" | |
let date = df.dateFromString(dob) | |
guard let val = date else{ | |
return (0, 0, 0) | |
} | |
var years = 0 | |
var months = 0 | |
var days = 0 |
OlderNewer