Re: How to get date string formats in System International Preferences
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.