Parsing Custom DateTimes

A

Alan Gilmour

Hi All,

Does anyone know how to parse a custom datetime string.

i.e. say I had a date time string in this format

string thedate = "Tue, 5 AUG 2003 13:29:00"
string theformat = "ddd, d mmm yyyy hh:mm:ss"

Could I then call DateTime.Parse(thedate,theformat), for example.

I had a look at the overloaded constructors on MSDN but never really found
anything helpful.


Thanks

Alan
 
V

Val Savvateev

You should be able to use DateTime.Parse, why don't you just give it a
try?....
 
A

Alan Gilmour

I did, it didn't work. However I now have the solution.


You Can specify a format, with DateTime.ParseExact()


Thanks
for your help

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top