RE: Time & Date Preferences?
RE: Time & Date Preferences?
- Subject: RE: Time & Date Preferences?
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Mon, 2 Jun 2003 12:29:29 -0400
It seems that you have to read those docs really carefully in this case.
As a lawyer by training, I think the following makes a certain amount of
sense. I suspect that's why so many normal people are fooled ;/. Or
perhaps I am being hypertechnical -- an epithet often hurled in my
direction. Anyway ...
%x is described as "date using the date representation for the _locale_"
(emphasis added). I assumed at first, like you, that this meant the
_user's_ settings for his/her own locale. I think (haven't tried it for a
while) the actual behavior is consistent with the default settings for the
_locale_ of the current user.
Consider a user in the United States who decides that the year should come
first. That preference is stored in the NSDateFormatString of the
system-wide user defaults. But that does not change the settings for the
"locale" of the United States, which seems to be what you get with %x (if I
remember it correctly).
Perhaps someone could confirm the foregoing (I am not near a Cocoa-capable
computer at the moment).
Jonathan
>
-----Original Message-----
>
From: email@hidden
>
[mailto:email@hidden]On Behalf Of Andreas Mayer
>
Sent: Monday, June 02, 2003 10:56 AM
>
To: email@hidden
>
Subject: Re: Time & Date Preferences?
>
>
>
Am Montag, 02.06.03 um 10:48 Uhr schrieb Emma Whan:
>
>
> For
>
> example if you wanted to get the user's date format string you would
>
> use [[NSUserDefaults standardUserDefaults]
>
> objectForKey:NSDateFormatString]
>
>
Ah! I thought [[NSCalendarDate calendarDate]
>
descriptionWithCalendarFormat:@"%x"] and [[NSCalendarDate calendarDate]
>
descriptionWithCalendarFormat:@"%X"] would use the current format as
>
selected by the user. Apparently not so. Thanks.
>
>
But shouldn't NSDateTimeOrdering be set to something corresponding to
>
the user preferred format? It's always 'MDYH' for me. Well, don't need
>
that at the moment ...
>
>
>
bye. Andreas.
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.