且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Crystal Reports 中将 DateTime 对象转换为字符串

更新时间:2023-11-07 14:00:58

你需要使用赋值运算符:=,而不是等价的=:

You need to use the assignment operator :=, not the equivalency one =:

EffectiveDateTimeString := ToText({Command.EffectiveDate} , "dd-MM-yyyy hh:mm:ss" );

*编辑 *

此代码段按预期工作:

ToText(CurrentDate + CurrentTime, "dd-MM-yyyy hh:mm:ss");

确保您的字段实际上返回的是日期/时间,而不是其中一个.

Ensure that your field is actually returning a date/time, rather than one or the other.