Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which day of the week? - Ios Swift [closed]

i'm new in iOs and swift and i don't know how to give a day in format yyyy-mm-dd and a function response with the day of the week like:

2014-08-04 -> Monday ([0])

thanks

like image 512
Pedro Manfredi Avatar asked Aug 04 '14 11:08

Pedro Manfredi


1 Answers

to take day of the week try this:

let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "EEEE"
let dayOfWeekString = dateFormatter.stringFromDate(date)
println(dayOfWeekString)
like image 100
zhukov.ever Avatar answered Oct 18 '22 20:10

zhukov.ever