COleDateTime::ParseDateTime
uses default parameter LANG_USER_DEFAULT
, it can be called as
COleDateTime dt;
dt.ParseDateTime("2022-07-04");
Or
dt.ParseDateTime("2022-07-04", VAR_DATEVALUEONLY, LANG_USER_DEFAULT);
"2022-07-04"
uses long date format so it should be safe, because it is clear that the year is at the start, and month is expected to be in the middle. I believe any LCID should return 2022-July-4th
(I am 60% sure!)
If the date string was short, it could get confused with MM/DD/YY
format, but that's not a problem here.
To make the lcid
manually, see the English-US example below, although it should not be necessary in this case.
LCID lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);