Skip navigation.
 
mlDate Format Conversion
FROM : Neto
DATE : Thu Jun 22 17:11:33 2006

Hi all...

MyApp is loading each line (string) of a .txt file to my "tempArray" 
and then, assigning each element of this "tempArray" to myArray.

This way, with your help, I implemented a simple "import from .txt 
file" function.

Everything works fine except for one line.

One line of this .txt file is a date. In fact, it is a string 
representing a date. It could be mm/dd/yy or dd/mm/yy

To I import that line I wrote:

[NSDate *tempDate=[tempArray objectAtIndex:(i+1)];
   [myArray setValue:tempDate forKey:@"gdate"];

Note that @"gdate", in the other hand, is an NSDate object.

My two problems:

1. All dates are resulting in 12/31/00...the code above is not working.
2. How can I make MyApp reads the string line and recognize if it is 
mm/dd/yy or dd/mm/yy?

Any ideas are welcome...

Thanks again

Neto

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