I’m using Delphi 2007.
I need write a FormatDateTime function that always return 01/01/ to a TDateEdit box (DevExpress component) as EditValue.
I’ve already tried…
tcxDateEdit1.EditValue := FormatDateTime('01/01/'+ 'yyyy',now);
and
tcxDateEdit1.EditValue := FormatDateTime('01/01/yyyy',Now);
but none of them worked.
It result in an error of converting variant of type string to double.
“Could not convert variant of type (String) into type (Double)”
I’m only guessing but your
EditValueproperty seems to be ofTDateTime(orTDate) type (whileFormatDateTimereturns astring). If that’s true you could try the following:See also: YearOf, EncodeDate, FormatDateTime documentation