let eventdate = "Picker date or get the date from server"
let YearFormat = NSDateFormatter()
YearFormat.dateFormat = "yyyy-MM-dd"
let hryDate = YearFormat.dateFromString(eventdate!.stringByReplacingOccurrencesOfString ("T00:00:00", withString: "").stringByReplacingOccurrencesOfString("-", withString: "/"))
let monthFormat = NSDateFormatter()
monthFormat.dateFormat = "MM.dd.YY" //"MMM.dd.yy" (OR) "dd.MMM.yyyy"
cell.expenseDateLabel.text = monthFormat.stringFromDate(hryDate!)
(or)
let dateString = dateFormatter12.stringFromDate(hryDate!)
No comments:
Post a Comment