Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > working with Date...

Reply
Thread Tools

working with Date...

 
 
Dade
Guest
Posts: n/a
 
      11-05-2003
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





 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      11-05-2003
"Dade" <> wrote...
> 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


 
Reply With Quote
 
 
 
 
Deming He
Guest
Posts: n/a
 
      11-05-2003
Dade <> wrote in message
news:8ign71-...
> 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);


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
response.redirect is not working but server.transfer is working gaurav tyagi ASP .Net 14 01-20-2006 04:22 AM
wifi not working on new hp, or not working after live update =?Utf-8?B?RHJhZ29ueA==?= Wireless Networking 1 10-01-2005 11:17 PM
ASP.NET client-side validation working, but button click not working Alan Silver ASP .Net 1 08-02-2005 03:50 PM
Cookies working on intranet but NOT working on Internet Martin Heuckeroth ASP .Net 5 04-01-2005 01:37 AM
Regular Expression validators NOT working, Required Field validators ARE working Ratman ASP .Net 0 09-14-2004 09:36 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57