Re: dateTime Manupulations

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

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


Date: Wed, 20 Oct 2004 19:38:33 +0200


"Cor Ligthert" <notmyfirstname@planet.nl> schrieb:
> In none of the threads I have read explicitly that there was needed a
> datetime conversion between strings, however it was a datetime conversion
> between a datetime value and a string value.

In /both/ threads Jay is referring two the question was about /parsing/ a
date that is represented as a string. This is a common scenario when dates
are stored in a specific format in a text file, for example. The questions
was not about a conversion between a 'Date' and a 'Date', this would not
make much sense.

> So show me first where that culture conversion is needed before you start
> to tell that for conversion between a string and a date a CDate is not the
> best choise.

'CDate' is definitely not the best choice when parsing dates represented as
strings in a specific format. All I can do is stating again what I already
said: I don't know if you are ignorant or just don't understand it. It
seems that you ignore every explanation, so further discussion is rather
useless.

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


Relevant Pages

  • Re: dateTime Manupulations
    ... datetime conversion between strings, however it was a datetime conversion ... between a datetime value and a string value. ... tell that for conversion between a string and a date a CDate is not the best ... > converting a DateTime with a specific format is one of those exceptions. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Excel VBA vs Time fields
    ... CDate can convert times entered as strings if they are in the correct format ... with the colon and the string contains hours. ... and cannot handle hours exceeding 24. ...
    (microsoft.public.excel.programming)
  • Re: how to get actual date format
    ... Not sure what you mean by "that can be used with the cDate() or isDate() functions" ... Both of these functions accept string expressions that represent dates and can ... Now, if you are trying to determine the format of the short date regional setting, ...
    (microsoft.public.vb.general.discussion)
  • Re: Thread: Date and Time
    ... In VB.NET you can use CDate instead of DateTime.Parse. ... DateTime.Parse is useful to convert a string to a DateTime based ... You can use the DateTime.ToString to format a date in a specific ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Thread: Date and Time
    ... In VB.NET you can use CDate instead of DateTime.Parse. ... DateTime.Parse is useful to convert a string to a DateTime based ... You can use the DateTime.ToString to format a date in a specific ...
    (microsoft.public.dotnet.framework.aspnet)