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

Date Format Conversion


  • Subject: Date Format Conversion
  • From: Neto <email@hidden>
  • Date: Thu, 22 Jun 2006 12:11:33 -0300

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
_______________________________________________
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: George Orthwein <email@hidden>
    • Re: Date Format Conversion
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Re: How to add menu to menu bar
  • Next by Date: Re: How to force an initial column sort with NSTableView and controller?
  • Previous by thread: NSUndoManager, NSTextView and exotic localization
  • Next by thread: Re: Date Format Conversion
  • Index(es):
    • Date
    • Thread