Re: dateTime Manupulations

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Herfried K. Wagner [MVP] (hirf-spam-me-here_at_gmx.at)
Date: 10/20/04


Date: Wed, 20 Oct 2004 20:35:50 +0200


"Cor Ligthert" <notmyfirstname@planet.nl> schrieb:
> Are you Jay's advocacy.

In this case yes, because he is right.

> When Jay can not speak for himself than show me in those threads that the
> OP's exaplictly wanted a conversion
> between a culture. I saw only conversions between types.

I /never/ talked about conversions between cultures. The OPs were asking
for a *converstion of a string representing a date in a specific format to a
'Date'*. The problem is completely independent from cultures. The problem
is about parsing a date string without caring about the culture, but by
providing a format string.

> This is your sentence in the thread before that.
>>'CDate' is locale-aware and will return different results for "10/10/1999"
>>on machines with different date formats.
>
> When you and Jay want to hard code a dateformat in a program,
> it is fine, I keep telling in this newsgroup to use as posible as
> can the globalization settings.

That's something different we are not talking about, because the OP doesn't
need that. Jay gave an excellent sample where parsing date strings in a
specific format is a requirement:

<URL:http://www.google.de/groups?selm=O40B7BUtEHA.636%40TK2MSFTNGP09.phx.gbl>

You either missed the post or ignored it.

-- 
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/> 


Relevant Pages

  • C# calling simple C++/CLI library deadlock
    ... 'global' calls back to CLR core libraries, maybe that String Alloc ... strvalue, Context^ context) ... strvalue, String^ format, IFormatProvider^ culture) ... return ParseFloat, strvalue, format, ...
    (microsoft.public.dotnet.languages.vc)
  • Re: date from different countries
    ... MM/dd/yyyy) regardless of culture then one can use: ... One way of overcoming this issue is to pad the parts of the date string to ... I want to be able to enter a date in dd/mm/yyyy format but return a true ... Dim junk As Date ...
    (microsoft.public.dotnet.languages.vb)
  • Re: What makes for a parseable DateTime string?
    ... Until recently running a string like ... The specifics of what is a legal DateTime string will depend on your current culture, and the format provider for DateTime in that culture. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Displaying Currency on a VB . NET windows form
    ... Calling decimal.ToStringwould create a currency formatted string ... current culture. ... You can put this string object in a TextBox. ... A date field has a "format" property. ...
    (microsoft.public.dotnet.general)
  • Re: DateTIme help
    ... This workds fine if my current culture in regional settings is "en-US"... ... So the only thing left is to make sure you provide an exact format string rather than relying on ToShortDateStringwhen converting back to a new string. ... If you specifically want the output format to be "mm/dd/yyyy" then provide that format to DateTime.ToString. ...
    (microsoft.public.dotnet.framework)