[Mono-dev] DateTime.Parse difference with .NET
Alfredo Jose Muela Romero
aioros at ono.com
Tue Aug 9 06:44:26 EDT 2005
El Tue, 09 Aug 2005 19:01:32 +0900
Atsushi Eno <atsushi at ximian.com> escribió:
> Hi,
>
> Now that it turned out that the bug is not reproducible with
> the latest svn HEAD (i.e. the bug report is invalid)...
Which bug? Did I talk to any bug? :-S If I did so I didn't mean
it, I just wanted to ask a doubt...
> Alfredo Jose Muela Romero wrote:
> > Hello,
> >
> > El Tue, 09 Aug 2005 13:30:19 +0900
> > Atsushi Eno <atsushi at ximian.com> escribió:
> >
> >
> >>Hello,
> >
> >
> > [...]
> >
> >
> >>In fact using DateTime.Parse() is somewhat stupid ;-) Read
> >>here:
> >>
> >>http://msdn.microsoft.com/msdnmag/issues/05/03/CultureInfo/d
> >efault >.aspx?side=true#a
> >>
> >> The DateTime.Parse method in the Microsoft .NET Framework
> >> has goals much like its predecessors, but unfortunately
> >> it suffers from some of the same problems. The code is
> >> slower since the extra checking takes time, and there
> >> will always be some new format that is not properly
> >> detected. In those older products, you may remember, the
> >> behavior was sometimes disparagingly referred to as "evil
> >> date parsing."
> >>
> >>At least DateTime.Parse() is COM dependent where the behavior
> >>is totally unpredictable and not countable from
> >>DateTimeFormatInfo.
> >
> >
> >
> > But in [1] we find that format string we need to specify
> > as a
> > valid format (see Globalization.DateTimeFormatInfo) it is
> > unfinished :-S
>
> If we have corresponding format string, it is likely to work
> like this case.
I guess I didn't understand the "unfinished concept" or your
answer... In other words... even if there are unfinished members
on a class, and consecuently the class is marked as unfinished,
is still the class usable? (I thought I couldn't...)
> > May be I lost something... what do you suggest to use
> > instead of
> > DateTime.Parse() or DateTime.ParseExact()?
>
> I don't understand why we need to find something "instead of
> DateTime.ParseExact()". Just use it.
So, should I use a string specify for myself (such as
"dd/MM/yyyy H:mm*:ss*") for the format?
Alfredo.
PS Thanks a lot for your time.
More information about the Mono-devel-list
mailing list