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

Query regarding DateFormat


  • Subject: Query regarding DateFormat
  • From: Nishant <email@hidden>
  • Date: Fri, 28 Nov 2003 18:01:52 +0000 (GMT)

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

________________________________________________________________________
Download Yahoo! Messenger now for a chance to win Live At Knebworth DVDs
http://www.yahoo.co.uk/robbiewilliams
_______________________________________________
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.

  • Follow-Ups:
    • Re: Query regarding DateFormat
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Changing the 'active' view?
  • Next by Date: CFPropertyList and NSDictionary/CFDictionary
  • Previous by thread: Changing the 'active' view?
  • Next by thread: Re: Query regarding DateFormat
  • Index(es):
    • Date
    • Thread