Re: arbitrary date formats based on user prefs
Re: arbitrary date formats based on user prefs
- Subject: Re: arbitrary date formats based on user prefs
- From: Robbie Haertel <email@hidden>
- Date: Wed, 22 Dec 2004 11:38:40 -0700
Is this what you are looking for?
NSCalendarDate provides several description... methods for
representing dates as strings. These methods—description,
descriptionWithLocale:, descriptionWithCalendarFormat:, and
descriptionWithCalendarFormat:locale:—take an implicit or explicit
calendar format. The user's locale information affects the returned
string. NSCalendarDate accesses the locale information as an
NSDictionary. If you use descriptionWithLocale: or
descriptionWithCalendarFormat:locale:, you can specify a different
locale dictionary. The following keys in the locale dictionary affect
NSCalendarDates:
taken from http://developer.apple.com/documentation/Cocoa/Conceptual/DatesAndTimes/index.html#//apple_ref/doc/uid/10000039i
On Wed, 22 Dec 2004 18:19:27 +0000, Ben Dougall <email@hidden> wrote:
>
> On Wednesday, December 22, 2004, at 04:00 pm, mmalcolm crawford wrote:
>
> >
> > On Dec 22, 2004, at 6:00 AM, Ben Dougall wrote:
> >
> >>>> how can i display particular date elements in the style of the
> >>>> user's prefs?
> >>> <http://developer.apple.com/documentation/Cocoa/Reference/
> >>> Foundation/ObjC_classic/Classes/NSUserDefaults.html>
> >>> See, for example, NSDateFormatString
> >> sorry to be a thicky but i can't see how that'd get various sets of
> >> date elements -- i'm trying to work out how to get a preferred format
> >> for different combinations of date elements.
> >> how can i get the preferred format for, for example, the full day
> >> name(%A) and the day number of month(%e) and the full month name(%B)
> >> as the user would want to see those date elements? is there a way to
> >> say "what's the preferred format for this combination of el>> %B %A ?" (or other combinations) and get back the format "%A, %e %B"
> >> or "%A, %B %e" or whatever depending on how the user would like it --
> >> based on the international date pref settings.
> >
> > Sorry, I misunderstood the question. There isn't a straightforward
> > way to do this. If for some reason you can't simply use the user
> > defaults, it sounds like you should probably have the user set their
> > own preferences for your application.
>
> ok thanks. further thought, just want to check: are the standard date
> format strings, in the user's preferred arrangement, available anywhere
> somehow? -- that is the actual format strings themselves for the
> established usual date formats?
>
> thanks, ben.
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden