2013-01-24 2 views
-2

가능한 중복 :
How do i add 1 day to a NSDate?현재 날짜로 특정 시간을 얻는 방법?

내가 string에서 NSDate

시간 (오전 10시)를 추가 할 wan't

이 같은 데이터를 얻을 :

10:00 AM 

전환하고 싶습니다. 이번에 string to NSDate 현재 날짜와 함께.

NSDate에서 나는 NSDate이 데이터를 원하는 2013-01-24 10:00:00 +0000

같은 데이터를 wan't.

어떻게하면 좋을지 제안 해주세요.

답변

1
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; 

     [dateFormatter setDateFormat:@"hh:mm a"]; 

     NSDate *date = [dateFormatter dateFromString:@"10:00 AM"]; 
관련 문제