C
Cor Ligthert
Exactly and therefore is CDate without a formatstring much better.There are systems that do not use Dutch as system culture...
))
I am glad that you agree at the end of this thread.
Cor
Exactly and therefore is CDate without a formatstring much better.There are systems that do not use Dutch as system culture...
))
Cor Ligthert said:Exactly and therefore is CDate without a formatstring much better.
z. f. said:when the string is 19/10/2004 00:15:51 even ParseExact can't parse it.
z. f. said:the addition of the CultureInfo.InvariantCulture parameter and the HH
instead of hh in the format did the difference.
it's working.
can you share more about the meaning of the CultureInfo.InvariantCulture and
why it works with it and not with null/nothing parameter?
Cor said:ZF
Did you tried my sample as well, that work forever and therefore as well
with database formats.
I am not sure if the setting in Isreal for dates in arabian figures is in
the US style or let say the European style. When it is in Isreal the US
style and you want to convert a date from let say European style you can
use.
So why should he try your CDate solution, if he can use
ParseExact while specifying the *expected* format???
He *knows* how the DateTime string is formatted, but he
doesn't know (and doesn't have to know) the culture, so
ParseExact is his friend.
bye
That does CDate as well and even in one time, without knowing anything of
globalization settings. So I do not understand your message.
Maybe a lack of knowledge from you?
Cor Ligthert said:That does CDate as well and even in one time, without knowing anything of
globalization settings. So I do not understand your message.
z. f. said:the addition of the CultureInfo.InvariantCulture parameter and the HH
instead of hh in the format did the difference.
it's working.
can you share more about the meaning of the CultureInfo.InvariantCulture
and
why it works with it and not with null/nothing parameter?
Thanks!
z.
Jay B. Harlow said:As we pointed out yesterday, CDate fails miserably! Please read & attempt to
understand the previous posts in this thread!
It may work for you as you are in a region that allows day month year,
however every one else it fails for!
CDate is region specific, ParseExact is not.
Jay B. Harlow said:Correct, it *can be* region specific. IMHO *Is* implies that is always is,
I hope you agree its not black & white, it depends on the format string
provided.
The point I am trying to get across is that ParseExact with a custom format
is not region specific, where as CDate (& DateTime.Parse most of the time)
is always region specific. In other words if you want a regional date
conversion use CDate or DateTime.Parse, if you want a regional agnostic date
conversion use DateTime.ParseExact with a custom format.
Cor Ligthert said:I have to say that my simple short solution does not work .
So it has to be with CDate when in Israel US settings are used
\\\
Thread.CurrentThread.CurrentCulture = New CultureInfo("FR-fr")
mydatarow("dtt") = CDate("19/10/2004 0:15:51")
Thread.CurrentThread.CurrentCulture = CultureInfo.InstalledUICulture
///