Created
June 22, 2014 18:49
-
-
Save aliharis/dc5dab8f280de421225d to your computer and use it in GitHub Desktop.
Convert UNIX Timestamp to NSDate and to user's local timezone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDate *dateTraded = [NSDate dateWithTimeIntervalSince1970:1408636621]; | |
NSDateFormatter *_formatter=[[NSDateFormatter alloc]init]; | |
[_formatter setLocale:[NSLocale currentLocale]]; | |
[_formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; | |
NSString *_date=[_formatter stringFromDate:dateTraded]; | |
NSLog(@"Final time: %@", _date); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment