I have a TDateTime
value (that I get as result from EndOfTheMonth(date)
) to a variant type. The result is wrongly rounded. Let's have a look at example:
data := EndOfTheMonth(date);
V := data;
ShowMessage(DateTimeToStr(data) + ' vs ' + VarToStr(V));
// output is
// data = 2012-01-31 23:59:59
// v = 2012-02-01 // why next day?
Is it designed behaviour? How to work around this?
DateTimeToStr(V)
shows the correct result too. Apparently, the issue is with theVarToStr()
function. – Proa