• 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: Query regarding DateFormat
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Query regarding DateFormat


  • Subject: Re: Query regarding DateFormat
  • From: Donald Hall <email@hidden>
  • Date: Sat, 29 Nov 2003 21:52:19 -0700

Shouldn't that be something like:

NSLog(@"sdf is: %@", sdf);

NSLog sends a 'description' message to the object and outputs the result as a string to the console so you have to call it as above.

Regards,

Don

At 10:00 PM -0800 2003/11/28, email@hidden wrote:
Hi All,

I'm using an NSDateFormatter to display dates in an
TextField and would like to display them in the user's
system preference format.
So, I used NSShortDateFormatString.
What I have done is ::
===============
NSString *sdf = [[NSUserDefaults
standardUserDefaults]stringForKey:NSShortDateFormatString];

NSDateFormatter *prefDateFormat = [[[NSDateFormatter
alloc] initWithDateFormat:sdf
allowNaturalLanguage:YES] autorelease];
================
Now my preference is set to UK (Day/Month/Year)
When I do an NSLog(sdf) I see "-1.438324e-229/-1/Y"
instead of "%e/%m/%Y".

Am I missing something? Is there someother way to do
it?

Thanks and Regards,
Nishant

--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.com
_______________________________________________
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: rounding a float
  • Next by Date: Re: NSIndexSet
  • Previous by thread: Re: Query regarding DateFormat
  • Next by thread: CFPropertyList and NSDictionary/CFDictionary
  • Index(es):
    • Date
    • Thread