Accessing international settings from NSCalendarDate?
Accessing international settings from NSCalendarDate?
- Subject: Accessing international settings from NSCalendarDate?
- From: Laurent Daudelin <email@hidden>
- Date: Sat, 22 Jun 2002 02:28:33 -0400
I already posted this question on MacOS X Dev, but since I didn't get a
single reply, I thought I should ask here as well (maybe there are better
experts here, hear hear!)
So, is there anyway that I can access the localization format selected by
the user in the system international preferences? Right now, I'm using
[someDate descriptionWithCalendarFormat:[[NSUserDefaults
standardUserDefaults] objectForKey:NSShortTimeDateFormatString] timeZone:nil
locale:nil]] and I get something like "21 Jun 2002 02:15 AM", but that
doesn't match at all what I tried to set in the "Date" pane of the
International preferences. Am I stuck again to go back to Carbon functions?
If so, I would need some pointers because I couldn't find how I could
translate an NSCalendarDate to a LongDateTime values, use LongDateString()
and LongTimeString() and convert the Str255 back to an NSString that I can
set to my textfield.
The Finder has no problem displaying date and time according to the
international settings, but the Finder is not a Cocoa app, while mine is...
Any idea? Thanks in advance!
-Laurent.
--
============================================================================
Laurent Daudelin <
http://members.cox.net/nemesys>
Logiciels Nemesys Software
mailto:email@hidden
cargo cult programming n.: A style of (incompetent) programming dominated by
ritual inclusion of code or program structures that serve no real purpose. A
cargo cult programmer will usually explain the extra code as a way of
working around some bug encountered in the past, but usually neither the bug
nor the reason the code apparently avoided the bug was ever fully understood
(compare shotgun debugging, voodoo programming).
_______________________________________________
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.