Reputation: 261
How do I convert from a unix epoch integer to date string?
Upvotes: 3
Views: 2997
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