You mayby need to retry the value of an enum.
For example : you have this enum : SalesUpdate::DeliverNow, and you will recover DeliverNow, not the label which can be in French, Dutch, English, …
You can proceed like this :
You can convert with the method DateTimeUtil::anyToDateTim([anyType]) BUT, I have receive some erros by use this method.
You can also use the conversion by a string !
curDate = systemDateGet();
newDateTime = DateTimeUtil::parse(strfmt("%1T00:00:00", date2str(curdate, 321, 2, 3, 2, 3, 4)));
For the time, you can use also the method : timeNow()
Anytype is great. It’s a primitive data type can use as a placeholder for any other data type, and comes in handy on many occasions. But don’t use it as a silver bullet, it might backfire.
Source : http://www.artofcreation.be/2009/04/07/wrong-argument-types-in-variable-assignment-part-2/