Re: Getting relative day-of-week name?
Re: Getting relative day-of-week name?
- Subject: Re: Getting relative day-of-week name?
- From: Rick Mann <email@hidden>
- Date: Wed, 24 Feb 2010 13:38:55 -0800
On Feb 24, 2010, at 12:22:56, mmalc Crawford wrote:
>
> On Feb 24, 2010, at 12:04 pm, Rick Mann wrote:
>
>> I'd like to take an NSDate and get a relative day-of-week name. For example, if today is 2/24, and the NSDate is some time on 2/23, it would be "Yesterday." If the NSDate were 2/22, it would be "Monday."
>>
>> Is there an existing format specifier for this (fully localized, etc)? Or must I roll my own for this?
>>
>
> NSDateFormatter > setDoesRelativeDateFormatting:
> Specifies whether the receiver uses phrases such as “today” and “tomorrow” for the date component.
>
> <http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSDateFormatter_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDateFormatter/setDoesRelativeDateFormatting:>
Sweet, thanks! I totally did not see that.
Oh, wait. Sorry, I should've specified iPhone OS. Doesn't seem to do that on iPhone OS.
Thanks, anyway.
--
Rick
_______________________________________________
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