Question

I have TDateTime variable named dtBegin. dtBegin is containing value "7/3/2000". I need to replace the Day only with "2" to change the value into "2/3/2000".

How to do this? I've been suggested to use RecodeDay() method in C++ Builder XE but the method is not worked. I put the dtBegin on the method to be:

RecodeDay(dtBegin, 2);

But the method is not returning the value that I want.

Is there any method to do this? Help me please. Thanks in advance.

Was it helpful?

Solution

RecodeDay is a function declared as System::TDateTime __fastcall RecodeDay(const System::TDateTime AValue, const System::Word ADay);, so you need to store the return value:

dtBegin = RecodeDay(dtBegin, 2);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top