• 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: Date Format Conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date Format Conversion


  • Subject: Re: Date Format Conversion
  • From: Andreas Mayer <email@hidden>
  • Date: Thu, 22 Jun 2006 18:58:16 +0200


Am 22.06.2006 um 18:11 Uhr schrieb Neto:

because I don't know how to implement the "checkCurrentSystemDateFormat" or the "checkFirstTwoCharacters" methods.

See documentation about NSDateFormatter and NSString.


To get the integer value of the first two characters of a string you could write


int value = [[theString substringToIndex:2] intValue];


Date formatting is a complex problem. For system versions prior to 10.4 support for date formatting was - um - bad. Support in Tiger seems to be much better. Since I don't have too much experience with the new date related methods, I suggest you read up on it yourself:


http://developer.apple.com/documentation/Cocoa/Conceptual/ DataFormatting/DataFormatting.html


3. As a last option, I may add a pop up that asks the user to inform if the date is dd/mm/yy or mm/dd/yy,

I don't know what your target audience is, so I can't say if this is indeed all you need. But please note that there are a *lot* more date formats than those two.



Andreas _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Date Format Conversion
      • From: Neto <email@hidden>
References: 
 >Date Format Conversion (From: Neto <email@hidden>)
 >Re: Date Format Conversion (From: Andreas Mayer <email@hidden>)
 >Re: Date Format Conversion (From: Neto <email@hidden>)

  • Prev by Date: Re: Newbie Q : connections between different nibs
  • Next by Date: Re: Date Format Conversion
  • Previous by thread: Re: Date Format Conversion
  • Next by thread: Re: Date Format Conversion
  • Index(es):
    • Date
    • Thread