My regional setting is australia.
I have a string '12/3/2003' (mm/dd/yy) in US format to be parsed as COleDateTime.
When I convert using COleDateTime::ParseDateTime, it considers 12 as date and 3 as month.
I know this is because of my regional setting.
How to make ParseDateTime to consider the string as US date string?
Displays 3/12/2003Code:CString sTimeString = "12/3/2003"; // 12 th month COleDateTime oleTime; oleTime.ParseDateTime(sTimeString,LOCALE_NOUSEROVERRIDE); // I tried this //oleTime.ParseDateTime(sTimeString,0 ); // I tried this also. AfxMessageBox(oleTime.Format("%m/%d/%y")); // the month 12 th becomes date
How to instruct ParseDateTime to consider the string in US format ?
Thanks a lot for your helps
Anita Eugene




Reply With Quote