working with Date...

D

Dade

Hi,
i need help working with COleDateTime Object...
I have the following :
int year=2003;
int month=11;
int day=05;

COleDateTime Data_i(year,month,day,0,0,0);

now i want to subtract one day to get the date 11/04/2003.
why is it not correct this?

COleDateTimeSpan OneDayDiff = Data_i - COleDateTime(0,0,1,0,0,0);

thanks
Davide
 
V

Victor Bazarov

Dade said:
i need help working with COleDateTime Object...
I have the following :
int year=2003;
int month=11;
int day=05;

COleDateTime Data_i(year,month,day,0,0,0);

now i want to subtract one day to get the date 11/04/2003.
why is it not correct this?

COleDateTimeSpan OneDayDiff = Data_i - COleDateTime(0,0,1,0,0,0);

You must have confused this (comp.lang.c++) newsgroup with the
microsoft.public.vc.mfcole one. Go and ask there, please. Here
COleDateTime is off-topic.

Victor
 
D

Deming He

Dade said:
Hi,
i need help working with COleDateTime Object...
I have the following :
int year=2003;
int month=11;
int day=05;

COleDateTime Data_i(year,month,day,0,0,0);

now i want to subtract one day to get the date 11/04/2003.
why is it not correct this?

COleDateTimeSpan OneDayDiff = Data_i - COleDateTime(0,0,1,0,0,0);

thanks
Davide
int nDay = Data_i.GetDay() - 1;
Data_i.SetDate(Data_i.GetYear(), Data_i.GetMonth(), iDays);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
anuragag27

Latest Threads

Top