How can I set current date in a property of an object in XML v1.0 using Spring-objects?

993 Views Asked by At

This my current code which works fine for set the dates but I want to set the current date as default how can I get this value? It's possibly to use system.DateTime.Now as a class of an object for get it?

<object type="Date" singleton="false">
       <property name="StartDate" value="2000-01-01" />
 </object>
1

There are 1 best solutions below

0
Overmachine On BEST ANSWER

You can use the expression language (SpEL) inside the xml instead of value to call system types.

<object type="Date" singleton="false">
   <property name="StartDate" expression="DateTime.Today" />
</object>