Convert date to utcDateTime

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 !

date curDate;
utcDateTime newDateTime;

curDate             = systemDateGet(); 
newDateTime         = DateTimeUtil::parse(strfmt("%1T00:00:00", date2str(curdate, 321, 2, 3, 2, 3, 4)));
//=> 01-02-2010T00:00:00

For the time, you can use also the method : timeNow()


AnyType and utcDateTime

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 :