Get Unix timestap for current date

 Problem

I want to get the Unix timestamp for current date/time.



 Recipe


// Get the Unix timestamp
let timestamp = NSDate().timeIntervalSince1970

print(timestamp)
				

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