Re: Convert a string to a datetime using a pattern

Tech-Archive recommends: Fix windows errors by optimizing your registry



string myString = "1-1-2000";
DateTime myDateTime = DateTime.Parse(myString);

Hope this helps,
Arjen



"Iwan Petrow" <xxxxyz@xxxxxx> schreef in bericht
news:1122464653.611036.165920@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I have a string which represent a date as follow: "dd-.MM-.yyyy hh:mm".
> How could I convert this string to DateTime type (I prefer somehow to
> set this as a pattern if it is possible because I have other
> possibilities as "dd~MM~yyyy, hh:mm")?
>
> Thanks.
>


.



Relevant Pages

  • Convert a string to a datetime using a pattern
    ... How could I convert this string to DateTime type (I prefer somehow to ... set this as a pattern if it is possible because I have other ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Convert a string to a datetime using a pattern
    ... > How could I convert this string to DateTime type (I prefer somehow to ... > set this as a pattern if it is possible because I have other ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Predicting the Future and Kolmogorov Complexity
    ... Predictability is based on the pattern itself. ... addition to the string. ... For any prediction scheme, there are computable strings that show no ... Out of this hole comes a ~2 cm blue marble followed by a red ...
    (talk.origins)
  • Re: macro for parsing text
    ... SUB will remove from any cell selected the pattern as you described (i.e. ... Dim c As Range ... Dim Temp As String ... Dim colMatches As MatchCollection ...
    (microsoft.public.excel.programming)
  • Re: macro for parsing text
    ... SUB will remove from any cell selected the pattern as you described (i.e. ... Dim c As Range ... Dim Temp As String ... Dim colMatches As MatchCollection ...
    (microsoft.public.excel.programming)