Get NSDate for current date

 Problem

I want to get the NSDate object for current date/time.



 Recipe


// Get NSDate for current date
let date = NSDate()

print(date)
				

Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)

 

 Playground