开发者

Convert from UNIX Epoch to Date String

开发者 https://www.devze.com 2023-01-29 12:40 出处:网络
How do I conv开发者_StackOverflowert from a unix epoch integer to date string?Code: NSUInteger *foo = 123456789;

How do I conv开发者_StackOverflowert from a unix epoch integer to date string?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消