PDA

Click to See Complete Forum and Search --> : DateDiff ?


tumblingdown
Jul 30th, 2001, 07:14 AM
Whats the best way to do DateDiff type functions in c++.

I need to be able to take a date, and add or subtract days, taking into account the different number of days in a given month.


?


td.

HarryW
Jul 30th, 2001, 08:23 AM
I expect there's a Windows API type thing that does it, but since I don't know what the API is and I haven't done this myself in C++, I'll keep quiet now.

tumblingdown
Jul 30th, 2001, 10:36 AM
nope (at least not pre Whistler).



td.

Aragorn
Jul 30th, 2001, 01:13 PM
I can't help you much. but maybe you find this interesting:
http://www.planetsourcecode.com/xq/ASP/txtCodeId.1100/lngWId.3/qx/vb/scripts/ShowCode.htm

It only adds days, not subtracts, but you may modify it to do so.
good luck! :)