-
May 25th, 2012, 01:10 PM
#1
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!
-
May 25th, 2012, 01:30 PM
#2
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/
-
May 29th, 2012, 04:40 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|