Skip navigation.
 
mlRe: Date Format Conversion
FROM : Andreas Mayer
DATE : Thu Jun 22 18:58:16 2006

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

Related mailsAuthorDate
mlDate Format Conversion Neto Jun 22, 17:11
mlRe: Date Format Conversion Andreas Mayer Jun 22, 17:37
mlRe: Date Format Conversion George Orthwein Jun 22, 17:42
mlRe: Date Format Conversion Neto Jun 22, 18:11
mlRe: Date Format Conversion Brian Stern Jun 22, 18:40
mlRe: Date Format Conversion Andreas Mayer Jun 22, 18:58
mlRe: Date Format Conversion Neto Jun 22, 19:03