How to get current day, month and year in NSDate() using Swift?

Just so that i never waste any more time in my life on this, this goes here..

Swift 1.x

Every changing depreciations and swift framework.. just making it more fun!


—— Updated 25th Dec.

As pointed out by Joey in comment below this is not working anymore. Coincidently i was working on something similar just few minutes back, so here is the updated code. [We have to pass the values now as array.]

Swift 2.x


Swift 3.x

You can extract various date components using the variables provided here: