0

I have a Date/Time they come from a Apache server in this format :

2011-05-20T14:21:00.103-04:00

How I can convert this Date/Time to NSDate...

Thanks

0

2 Answers 2

4

Use an NSDateFormatter. You'll need to specify the dateFormat, and the patterns you can use are available here.

Sign up to request clarification or add additional context in comments.

Comments

0
[NSDate dateWithString:@"2011-05-20T14:21:00.103-04:00"];

2 Comments

This method does not exist on iOS.
It's deprecated in iOS. I didn't notice iphone tag. Btw strftime() will work fine even in iOS. So there is still a one-liner possibility

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.