I need to parse an american date string to extract the date.
COleDateTime dData;
LCID lcid = 0x409; // 0x409 is the locale ID for English US
CString strDate;
dData.ParseDateTime("10/1/2014 9:43:00 AM", VAR_DATEVALUEONLY);
strDate = dData.Format(0, lcid);
I expect this to return 1-Oct-2014 but instead it return 10-Oct-2014
Can someone please tell me what I am doing wrong here?
I think you want to pass the
lcid
to theParseDateTime()
too: