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

Hybrid View

  1. #1
    Join Date
    May 2012
    Posts
    2

    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?

    Thanks!

  2. #2
    Join Date
    May 2012
    Posts
    2

    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.

    http://hashfactor.wordpress.com/2009...with-timezone/

  3. #3
    Join Date
    Feb 2009
    Posts
    2

    Re: Simple convert date in C#?

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

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
  •  





Click Here to Expand Forum to Full Width

Featured