CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012

    Simple convert date in C#?

    Hi All,

    I normally don't post questions, but google is giving me a brain overload with this one. Simply put, I am calling an external class, which returns me a date. This date looks like this:

    Tue Apr 24 18:49:25 CDT 2012

    I just need to get this date in DateTime format, so I can insert it into my sql compact 3.5 database. I haven't been able to find a clear cut easy method for converting a custom date like this one, and am almost to the point now of using substring to get it to look the way I want. Does anyone have an idea of how this can be done with the standard system.convert or some other method?


  2. #2
    Join Date
    May 2012

    Talking Re: Simple convert date in C#?

    As luck would have it, I think I found the answer right after posting this. I'm getting ready to try it out, but it looks promising. I found the article here in case you are interested.


  3. #3
    Join Date
    Feb 2009

    Re: Simple convert date in C#?

    DateTime dt = new DateTime();
    dt =DateTime.Parse(string);

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)