Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert Unix timestamp into Swift NSDate object? [closed]

I'm getting dates as Unix timestamps through my API and I want to convert them into NSDate objects in Swift.

How can I do that?

like image 559
dead_man Avatar asked Nov 10 '14 12:11

dead_man


1 Answers

Try this:

var date = NSDate(timeIntervalSince1970: timeInterval)
like image 51
Marcos Crispino Avatar answered Oct 24 '22 10:10

Marcos Crispino