Re: Date Format Conversion
Re: Date Format Conversion
- Subject: Re: Date Format Conversion
- From: Neto <email@hidden>
- Date: Thu, 22 Jun 2006 13:11:14 -0300
Andreas,
Thanks for you answer, (in fact, I'm using your code to get the lines
of the .txt file) but I don't want to give up so easily nor I think
it is so obvious.
It is impossible to say what 03/04/06 means, when you analyze it
alone, out of any context.
But that's not the case. Let me give you some extra info (just take
this assumptions for granted):
1. The .txt was generated by another application, and most likely at
the same machine, using the same current date format setting.
2. This will be a one-operation-followed-by-the-other. I mean, the
user probably will export the .txt file from the old application, and
import it at MyApp in the next moment.
3. The old app exports ONLY in dd/mm/yy or mm/dd/yy.
4. There will be always hundreds of "elements" in the tempArray.
At the present, the user will have to input the dates manually, so
anything I can do to make this task easier, may help him.
With all this info in mind, I can think of a couple of ideas to, at
least, try to help the user on this issue...just don't know to
implement them.
For example:
1. The .txt file was created by the same user, probably using the
same date format he is using (yes...this may not be true...but assume
it is true). So the app may get the current system date format and
act accordingly.
2. Since there will be more than one hundred entries (assume this is
true), the app may check the two first characters of the date string,
and look for a value higher than 12. If it finds, it uses dd/mm/yy
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, but it will be a lot better if
the application was able to find it out by itself.
Anyway...just thoughts, because I don't know how to implement the
"checkCurrentSystemDateFormat" or the "checkFirstTwoCharacters" methods.
Neto
On Jun 22, 2006, at 12:37 PM, Andreas Mayer wrote:
Am 22.06.2006 um 17:11 Uhr schrieb Neto:
2. How can I make MyApp reads the string line and recognize if it
is mm/dd/yy or dd/mm/yy?
Huh? Obviously, you can't.
There's no way to know if 03/04/06 is to mean March 4th 2006 or
April 3rd 2006 - or even June 4th 1903 - without explicitly
defining a date format.
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
_______________________________________________
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