You can call [[NSLocale currentLocale] localeIdentifier], to get the
locale identifier of the user's preferred locale, and then create
another NSLocale from it. This will be a locale that doesn't have any
(not just formatting) user preference overrides in it but is still the
user's preferr
Houdah - ML Pierre Bernard wrote:
NSMutableString *dateFormat = [NSMutableString stringWithString:
[dateFormatter dateFormat]];
[dateFormat replaceOccurrencesOfString:@"d" withString:@"dd"
options: 0 range:NSMakeRange(0, [dateFormat length])];
Unrestricted replacement of meta-characters
Figured out one way to get the desired result. But really don't like
it. I'd much rather have NSLocal tell me if day or months value should
go first.
Anyway, here it goes:
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init]
autorelease];
[dateFormatter setFo
Can you use separate formatters, one for the date, another for the
time, and just concatenate the resulting strings?
On Aug 11, 2009, at 09:51:59, Houdah - ML Pierre Bernard wrote:
Hi Sean,
I want to respect the user's locale, yet ignore his/her preferences
as to formatting.
I thought ab
There are cases where that's totally appropriate. Maybe in a report it
requires a leading zero. You still want to respect the user's settings
in all other areas.
On Aug 11, 2009, at 11:48 AM, Sean McBride wrote:
On 8/11/09 6:39 PM, Houdah - ML Pierre Bernard said:
I am trying to format dat
Hi Sean,
I want to respect the user's locale, yet ignore his/her preferences as
to formatting.
I thought about modifying the format I get from the standard styles. I
would however expect NSLocale to know the correct order of elements in
the date format.
Pierre
So you want to use the us
On 8/11/09 6:39 PM, Houdah - ML Pierre Bernard said:
>I am trying to format dates for display. So far I have been using this
>formatter:
>
> NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init]
>autorelease];
>
> [dateFormatter setFormatterBehavior:NSDateFormatterBeh
Hi!
I am trying to format dates for display. So far I have been using this
formatter:
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init]
autorelease];
[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[dateFormatter setDateStyle:NSDat