3

Possible Duplicate:
Is there a simple way of converting an ISO8601 timestamp to a formatted NSDate?
How to convert string to date in objective-c?

If I do requestForGrpahPath:@"me/inbox" with read_mailbox permission then I get this:

"data": [
          {
            "id": "XXXXXXXXXXXXXXXXX",
            "from": {
              "name": "XXXXXXXXXXXX",
              "id": "XXXXXXXXXXXXXXX"
            },
            "message": "yeup!",
            "created_time": "2012-12-03T10:28:21+0000"   // how to convert this time to normal NSdate
          }, 
Community
  • 1
  • 1
nr5
  • 4,228
  • 8
  • 42
  • 82

1 Answers1

6

Date format in your case is,

NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH:mm:ssZ"];
NSDate* date = [dateFormatter dateFromString:dateString];

You can check the other links I have mentioned in comments for more details.

iDev
  • 23,310
  • 7
  • 60
  • 85