Created
July 9, 2012 03:12
-
-
Save piaoapiao/3074028 to your computer and use it in GitHub Desktop.
iOS time
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 *date = [NSDate dateWithTimeIntervalSince1970: 1341802865565/1000]; | |
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; | |
[dateFormat setDateFormat:@"dd/MM/yyyy"]; | |
NSString *dateStr = [dateFormat stringFromDate: date]; | |
NSDateFormatter * formatter = [[NSDateFormatter alloc ] init]; | |
//[formatter setDateFormat:@"YYYY.MM.dd.hh.mm.ss"]; | |
[formatter setDateFormat:@"YYYY-MM-dd hh:mm:ss:SSS"]; | |
NSString *date = [formatter stringFromDate:[NSDate date]]; | |
//timeNow = [[NSString alloc] initWithFormat:@"%@", date]; | |
NSLog(@"date:%@",date); | |
double num = [[NSDate date] timeIntervalSince1970]; | |
// num = CFAbsoluteTimeGetCurrent(); | |
NSLog(@"num:%d",num); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment