Skip navigation.
 
mlRe: arbitrary date formats based on user prefs
FROM : Robbie Haertel
DATE : Wed Dec 22 19:38:40 2004

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_removed>> 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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/robbie.<email_removed>
>
> This email sent to robbie.<email_removed>
>

Related mailsAuthorDate
mlarbitrary date formats based on user prefs Ben Dougall Dec 22, 00:33
mlRe: arbitrary date formats based on user prefs Robbie Haertel Dec 22, 01:32
mlRe: arbitrary date formats based on user prefs mmalcolm crawford Dec 22, 01:46
mlRe: arbitrary date formats based on user prefs Ben Dougall Dec 22, 15:00
mlRe: arbitrary date formats based on user prefs mmalcolm crawford Dec 22, 17:00
mlRe: arbitrary date formats based on user prefs Ben Dougall Dec 22, 19:19
mlRe: arbitrary date formats based on user prefs Robbie Haertel Dec 22, 19:38
mlRe: arbitrary date formats based on user prefs mmalcolm crawford Dec 22, 20:18
mlRe: arbitrary date formats based on user prefs Sean McBride Dec 27, 07:42