Ian Livingstone
Ian Livingstone

Reputation: 261

Convert from UNIX Epoch to Date String

How do I convert from a unix epoch integer to date string?

Upvotes: 3

Views: 2997

Answers (1)

user142019
user142019

Reputation:

Code:

NSUInteger *foo = 123456789;
NSString *bar = [[NSDate dateWithTimeIntervalSince1970:foo] description];

PLEASE PLEASE PLEASE PLEASE PLEASE be user-friendly and show the date according to the locale of the user: Cocoa - Localized string from NSDate, NSCalendarDate

Upvotes: 9

Related Questions