这是我当前的代码,可以很好地设置日期,但我想将当前日期设置为默认日期,我如何才能获得这个值? 有没有可能用system.DateTime.Now作为一个对象的类来get呢?
<object type="Date" singleton="false">
<property name="StartDate" value="2000-01-01" />
</object>
请您参考如下方法:
您可以在 xml 中使用表达式语言 (SpEL) 而不是值来调用系统类型。
<object type="Date" singleton="false">
<property name="StartDate" expression="DateTime.Today" />
</object>
