SSamTure.net

워드프레스

[objective-c]timestamp 관련

NSTimeInterval timeStamp = 1282093277;

NSDate* date = [NSDate dateWithTimeIntervalSince1970:timeStamp];

NSLog(@”date=%@”, date); // date=2010-08-18 10:01:17 +0900

1 Comment

  1. 임민형(Min H. Lim
    2011/01/05 at 00:16 · Reply

    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; //this is the sqlite's format
    NSDate *date = [formatter dateFromString:aDateTime];

Leave a Reply

Your email address will not be published. Required fields are marked *