I Have a String.
NSString *str=@"January-06-2012";
How would I convert the above NSString like this.
@"2012-01-06 00:00:00 +0000";
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use NSDateFormatter class .. YOu would need two of them .. one to convert your NSString* str to a date using [dateformatter dateFromString] and then another to convert your newly created date object to the differently formatted string using [dateformatter1 stringFromDate]
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSDateFormatter_Class/Reference/Reference.html