Problem with COleDateTime
-
Hi, I want to convert a CString to COleDateTime. I'm using COleDateTime::ParseDateTime()and passing it the string as _T("1/25/1996 8:30:00") which is a valid format acc. to MSDN. But still, it is not working. Does anyone have any idea of what could be wrong or what setting do I need to change in my workspace (or on my system) to use COleDateTime properly? Regards, Pravin
-
Hi, I want to convert a CString to COleDateTime. I'm using COleDateTime::ParseDateTime()and passing it the string as _T("1/25/1996 8:30:00") which is a valid format acc. to MSDN. But still, it is not working. Does anyone have any idea of what could be wrong or what setting do I need to change in my workspace (or on my system) to use COleDateTime properly? Regards, Pravin
Are you sure the regional settings for the date on your computer are set to 'MM/dd/yyyy' (or somethoing like that ;P)?? This may be the source of the problem...
-
Are you sure the regional settings for the date on your computer are set to 'MM/dd/yyyy' (or somethoing like that ;P)?? This may be the source of the problem...
From my testing,
ParseDateTime()
does not care about the regional settings. I use dd-MMM-yyyy H:mm for mine and I can pass a dozen different formats toParseDateTime()
all yielding correct results.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)