UtcDateTime Dynamics AX

Hi,
I want to compare a date field with the current date of the system
My field is then call eg DateField and I want to display the commands in this record day, knowing that my field is type UtcDateTime.
datefield> = dateSystemBeginDay
datefield <= ​​dateSystemEndDay
then there exists a method that defines and dateSystemBeginDay dateSystemEndDay
thank you

I’m not sure your purpose for this, but here is code to do what you’re asking. You should look into DateTimeUtil::getTimeZoneOffset(…).

static void Job72(Args _args)

{

date systemDate;

utcDateTime utcStart, utcEnd;

;

systemDate = DateTimeUtil::date(datetimeutil::getSystemDateTime());

info(strfmt(“System Date: %1”, systemDate));

utcStart = DateTimeUtil::newDateTime(systemDate, 0);

info(strfmt(“UTC Start: %1”, utcStart));

utcEnd = DateTimeUtil::addDays(utcStart, 1);

info(strfmt(“UTC End: %1”, utcEnd));

}