> On Nov 22, 2015, at 6:04 PM, Alex Hall <mehg...@icloud.com> wrote: > > >> On Nov 22, 2015, at 5:06 PM, Jerry Krinock <je...@ieee.org> wrote: >> >> >>> On 2015 Nov 22, at 13:12, Alex Hall <mehg...@icloud.com> wrote: >>> >>> Is there something else I have to do, like tell the formatter what order to >>> expect components to be in? >> >> Yes, and more. You must set the dateFormat property of your date formatter >> exactly. >> >> Documentation of property ‘dateFormat’ refers you to click on the “Date >> Formatting Guide”. From there, you click on “Date Formatters”. Once there, >> scroll down to "Use Format Strings to Specify Custom Formats” and what to >> your wondering eyes does appear but a list of links to Unicode Consortium >> standards. Click on the one for the OS version you are targetting. Once >> there, read the fine print carefully. After 20 minutes or so you should >> have it working :) > > Thanks! I thought, for some reason, that NSDateFormatters could figure out > the date from any string with the necessary information—I guess I was > thinking of AppleScript. > > One follow-up, as I’m looking at all this: is there a reason to use > setDateFormat over templates? The header for NSDateFormatter keeps talking > about template strings, but online, all I see is setDateFormat(“some > formatted string”). I haven’t dug deeply into this yet, so feel free to > ignore this question if it’s quite obvious. I thought I’d ask while I was > responding, before I go back to the docs. Thanks.
Update: it seems to work. I ended up going with something like: //"Sun Nov 22 21:00:39 +0000 2015" self.tweetDateToStringDateFormatter.dateFormat = "EEE MMM dd HH:mm:ss ZZZ yyyy" and I get a date that appears correct. I'd still be curious to know about templates, but this works so I won't spend time on it right now. Off to figure more about table cells. I think this means a bit more with bindings… *shudder* >> >> >> _______________________________________________ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> 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: >> https://lists.apple.com/mailman/options/cocoa-dev/mehgcap%40icloud.com >> >> This email sent to mehg...@icloud.com > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com