'NSDate'에 해당하는 글 1건

// NSDate -> NSStirng
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];

NSDate *now = [[NSDate alloc] init];
NSString *nowText = [dateFormatter stringFromDate:now];          // 2014-08-28 04:12:21



// NSStirng -> NSDate
NSString *dateString = @"2014-08-28";
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"]; 

NSDate *dateFromString = [dateFormatter stringFromDate:dateString];     // NSDate로 바뀜..

WRITTEN BY
tucan.dev
개인 iOS 개발, tucan9389

,