• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: dateFromString won't accept this string:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dateFromString won't accept this string:


  • Subject: Re: dateFromString won't accept this string:
  • From: Alex Zavatone <email@hidden>
  • Date: Mon, 23 Nov 2015 09:33:26 -0500

Have you looked into The spec for date formatting?

It is seriously helpful. It's some ISO document.

Specify the format at which the date is coming in and it should convert.

I will send you my crappy routines for this for iOS.

Sent from my iPhone

> On Nov 23, 2015, at 9:06 AM, Alex Hall <email@hidden> wrote:
>
>
>> On Nov 23, 2015, at 8:00 AM, Sandor Szatmari <email@hidden> wrote:
>>
>> Alex,
>>
>> Have you tried looking at NSDataDetector. http://nshipster.com/nsdatadetector/ <http://nshipster.com/nsdatadetector/>
> Thanks for the suggestion. I don't think that would apply here, though; I have some JSON data that includes a date as a string. I need to convert that to an NSDate object so I can then display it however the user wants, or compare it to now, and such. However, that's a really useful page (I love NSHipster) and I'll save it for another project I'm thinking about where data detectors will be useful.
>>
>> Sandor
>>
>>> On Nov 22, 2015, at 16:12, Alex Hall <email@hidden <mailto:email@hidden>> wrote:
>>>
>>> Hey list,
>>> I’m using NSDateFormatter.dateFromString() to make a date from the date string in a tweet. However, it seems to be returning nil, and I’m not sure why. Is there something else I have to do, like tell the formatter what order to expect components to be in? The string is something like:
>>>
>>> "Sun Nov 22 21:00:39 +0000 2015”
>>>
>>> Thanks for any suggestions anyone has.
>>> _______________________________________________
>>>
>>> Cocoa-dev mailing list (email@hidden <mailto:email@hidden>)
>>>
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com <http://lists.apple.com/>
>>>
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden <mailto:email@hidden>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: dateFromString won't accept this string:
      • From: Sandor Szatmari <email@hidden>
References: 
 >dateFromString won't accept this string: (From: Alex Hall <email@hidden>)
 >Re: dateFromString won't accept this string: (From: Sandor Szatmari <email@hidden>)
 >Re: dateFromString won't accept this string: (From: Alex Hall <email@hidden>)

  • Prev by Date: Re: dateFromString won't accept this string:
  • Next by Date: Re: Bunch of CoreData based NSDocument questions.
  • Previous by thread: Re: dateFromString won't accept this string:
  • Next by thread: Re: dateFromString won't accept this string:
  • Index(es):
    • Date
    • Thread