• 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
Queries on Date Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Queries on Date Problems


  • Subject: Queries on Date Problems
  • From: "Prashanth Rao" <email@hidden>
  • Date: Tue, 19 Nov 2002 19:45:39 +0530

Hi,

In our application, all the dates are needed to be displayed as per date
format setting in the International panel of System Preferences. We are
facing two issues with regards to this.

1st Issue:

We are using [[NSUserDefaults standardUserDefaults]
stringForKey:NSShortDateFormatString] to get the date format.

This does not always return us the correct format.

1. I created a new user account on my Mac machine.
2. Logged in as this user.
3. Launched the application.
4. The date displayed is in DD MON YYYY format ( space as separator ) even
though in the International setting, the date format is MM/DD/YYYY (
Default US Region ).
5. I then go and touch the Region or anything in the Date Panel of
International settings and relaunch the application, the date format is
taken up correctly.

Is there any solution to this problem ?

2nd Issue:

The NSDateFormatter validates only the Date Format but not the actual date.
We use the following

NSDateFormatter *f = [[NSDateFormatter alloc]
initWithDateFormat:kDateFormat allowNaturalLanguage:NO];
// kDateFormat is the System Date Format. Eg. MM/DD/YYYY

[f getObjectValue:&obj forString:dateString errorDescription:&error]; //
dateString - Input date from user Eg. 33/33/2002

Here only the Format gets validated and not the actual date as such.

The output displayed is 04/23/2095

Is there any method which validates the Date too ?

Cheers,
Prashanth.
_______________________________________________
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: Close button on Single Window Utilities
  • Next by Date: Re: NSWorkspace, Email, Attachments...
  • Previous by thread: Re: NSWorkspace, Email, Attachments...
  • Next by thread: Animated GIF with transparency?
  • Index(es):
    • Date
    • Thread