While working in AX2009, i have been Juggling with anyToDateTime() method of DateTimeUtil class. If you use the below code above error will get encountered on the fly.
UtcDateTime dt;
Date d = 01\03\2009;
;
dt = DateTimeUtil::anyToDateTime(d);
info(strFmt('%1', dt));
In order to get this fixed we have to pass any time by using below method of dateTimeUtil class.
dt = DateTimeUtil::newDateTime(d,str2time('00:00:00'));
No comments:
Post a Comment