M
Mattias
I have a problem with the usage of the Restrict function in C++. I want
to use a query like "[Start] >= '1/1/2005 00:00'" but the problem is
that the date and times must be specified using the correct locale. The
time part is important since Outlook otherwize use the "start of
working day" for the time part. But I also want to include the all day
events for that day!!!
In the Microsoft Office VBA documentation they suggest that the Visual
Basic function FormatDateTime is used, but this function doesn't exist
in C++. I mostly use the MFC COleDateTime for my date work. The date
part is no problem. I just use:
COleDateTime dtDate(2005, 1, 1, 0, 0, 0);
CString strDatePart = dtDate.Format(VAR_DATEVALUEONLY);
But for the time part I cannot use the VAR_TIMEVALUEONLY since the
seconds are used there as well.
How should I format the time part??? I've tried to just append _T("
00:00") to the date but that only work using some locales. I suspect
that AM/PM parts must be used sometimes (12/24 hour clocks????)
to use a query like "[Start] >= '1/1/2005 00:00'" but the problem is
that the date and times must be specified using the correct locale. The
time part is important since Outlook otherwize use the "start of
working day" for the time part. But I also want to include the all day
events for that day!!!
In the Microsoft Office VBA documentation they suggest that the Visual
Basic function FormatDateTime is used, but this function doesn't exist
in C++. I mostly use the MFC COleDateTime for my date work. The date
part is no problem. I just use:
COleDateTime dtDate(2005, 1, 1, 0, 0, 0);
CString strDatePart = dtDate.Format(VAR_DATEVALUEONLY);
But for the time part I cannot use the VAR_TIMEVALUEONLY since the
seconds are used there as well.
How should I format the time part??? I've tried to just append _T("
00:00") to the date but that only work using some locales. I suspect
that AM/PM parts must be used sometimes (12/24 hour clocks????)