• 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: How to get date string formats in System International Preferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get date string formats in System International Preferences


  • Subject: Re: How to get date string formats in System International Preferences
  • From: Lorenzo <email@hidden>
  • Date: Wed, 26 May 2004 11:34:17 +0200

You can get the date string using the User's System International
Preferences this way:

NSCalendarDate *calDate = [NSCalendarDate calendarDate];
NSString *nowString;

// using only the sys pref format
nowString = [calDate descriptionWithLocale:
[[NSUserDefaults standardUserDefaults]
dictionaryRepresentation]];

// or if you want to customize the format, keeping the
// language and other formats
NSString *format = @"%A, %B %d, %Y - %H:%M:%S";
nowString = [calDate descriptionWithCalendarFormat:format
locale:[[NSUserDefaults standardUserDefaults]
dictionaryRepresentation]];


Best Regards
--
Lorenzo
email: email@hidden

> From: Satoshi Matsumoto <email@hidden>
> Date: Wed, 26 May 2004 10:47:35 +0900
> To: Lorenzo <email@hidden>
> Subject: How to get date string formats in System International Preferences
>
> Hi
>
> on 04.5.26 0:59 AM, Lorenzo at email@hidden wrote:
>> you should get the current date/time this way:
>> NSCalendarDate *nowDateTime = [NSCalendarDate calendarDate];
>>
>> then you can transform "nowDateTime" to a simple NSString this way:
>> NSString *fullDateTimeString = [nowDateTime description];
>
> Does anybody know how to get the date string formats that are defined in
> System International Preferences?
>
> Satoshi
>
> -----------------------------------------------------
> Satoshi Matsumoto <email@hidden>
> 816-5 Odake, Odawara, Kanagawa, Japan 256-0802
_______________________________________________
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.


  • Prev by Date: Re: Table View not Getting Drag messages
  • Next by Date: Re: Problem with NSOutlineView outlineView:willDisplayCell:forTableColumn:item: delegate method
  • Previous by thread: Re: Problem with NSOutlineView outlineView:willDisplayCell:forTableColumn:item: delegate method
  • Next by thread: Changing the desktop picture
  • Index(es):
    • Date
    • Thread