Parsing a string containing a datetime value is always a pain.
While
COleDateTime::ParseDateTime[
^] supports a range of formats, those containing weekday names are not supported as far as I know (see also above link). And it will fail in most cases when the string uses a different locale (e.g. when reading from a file or database). You are using an English date format in your example. If your system or user locale setting is not English, parsing may fail therefore. Then you may try passing
MAKELCID(MAKELANGID(0x09, 0x01), SORT_DEFAULT)
as LCID.
If you know the exact format, it would be better to use
scanf, _scanf_l, wscanf, _wscanf_l[
^] ignoring the weekday name and looking up the month name afterwards.
If the user should enter the date inside your program use the DateTimePicker control or at least an edit field with an input mask.
For the above reasons avoid using strings for datetime values if possible. If they are required (e.g. for log files), use a locale independant format like
ISO 8601 - Wikipedia, the free encyclopedia[
^] which can be simply parsed.