• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableColumn Date Format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableColumn Date Format


  • Subject: Re: NSTableColumn Date Format
  • From: Neto <email@hidden>
  • Date: Sat, 17 Jun 2006 00:31:05 -0300

I doing something wrong here, and maybe someone could help.
I reproduced the exact code from the example bellow. My locale is pt_BR and instead of getting the Output described bellow, I'm getting:


formattedDateString for locale pt_BR: 01/02/01

Not Jan 2, 2001 as I may expect from NSDateFormatterMediumStyle
Nor  2, Jan 2001 as I may expect from my current locale.

Any tips?



NSDateFormatter *dateFormatter =
[[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
[dateFormatter setTimeStyle:NSDateFormatterNoStyle];
NSDate *date =
[NSDate dateWithTimeIntervalSinceReferenceDate:118800];
NSString *formattedDateString = [dateFormatter stringFromDate:date];
NSLog(@"formattedDateString for locale %@: %@",
[[dateFormatter locale] localeIdentifier], formattedDateString);
// Output: formattedDateString for locale en_US: Jan 2, 2001




On 16 Jun 2006, at 21:58, mmalcolm crawford wrote:


On Jun 16, 2006, at 5:31 PM, Neto wrote:

In IB I binded formater to that NSTableColumn to %m/%d/%y
The problem is: when the user has another setting at the system (like d/m/y) the column still shows m/d/y.
How do I set the column to reflect the user's date format?


<http://developer.apple.com/documentation/Cocoa/Conceptual/ DataFormatting/index.html>

mmalc

_______________________________________________ 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
  • Follow-Ups:
    • Re: NSTableColumn Date Format
      • From: mmalcolm crawford <email@hidden>
References: 
 >Deploying Cocoa Applications (From: Jerrod Fowkes <email@hidden>)
 >Re: Deploying Cocoa Applications (From: Scott Anguish <email@hidden>)
 >NSTableColumn Date Format (From: Neto <email@hidden>)
 >Re: NSTableColumn Date Format (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Alignment in NSToolbar?
  • Next by Date: Re: NSTableColumn Date Format
  • Previous by thread: Re: NSTableColumn Date Format
  • Next by thread: Re: NSTableColumn Date Format
  • Index(es):
    • Date
    • Thread