I want to format a COleDateTime as a CString, so i use
COleDateTime dt = GetMyDateTimeObj();
dt.Format(LOCALE_NOUSEROVERRIDE, GetCurrentLocaleID());
Since my program is multilanguage, GetCurrentLocaleID gives me the LCID currently selected (not in windows but in my program). So the above gives me the correctly formated string according to the selected user-language but its always in a format "date-with-year + time-with-seconds". I think this is the short format of a date and the long format of the time accordong to windows regional settings.
What can i do to get the String with - the year as just 2 numbers? - completely without the year? - the time-part without seconds?
Are there any switches to COleDateTime::Format
that can give me year-as-2-digits, time-without-seconds but keeps fieldorder and separators specified by the LCID
?
Of course i dont want to change any windows-regional-settings to do this and i dont want to use any fixed format-strings like _T("%d.%m.%Y %H:%M:%S")
as this would break language-specific order of fields and separators.
Thanks for your hints and answers
Micha