Parsing strings containing date and time

  • Thread starter Thread starter Morten Wennevik
  • Start date Start date
M

Morten Wennevik

I'm trying to get a DateTime object out of different strings containing
unknown datetimeformat.
An example would be "Mon, 24 Nov 2003 15:23:13 +0100"

DateTime.Parse() does not work and I'm not sure how to use the
IFormatProvider or DateTimeStyles
Any ideas?

(NB! currentculture is not English and time formats may also be non
english)
 
Hi,

DateTimeStyles and DateTimeFormatInfo should be the way to go (the latter
implements IFormatProvider for dates/times by the way). Just play with the
settings to see what works - and MSDN Library docs should help you in that.
 

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

Back
Top