If you want just to convert specified date to dateTime, and it should be beginning of this day (date time), you can use
DateTimeUtil::newDateTime(mkDate(17, 12, 2019), 0);
//17th of December 2019
Or just
DateTimeUtil::newDateTime(systemdateGet(), 0);
//current system date
But if you want to have maximum time from that date, so it means hour 23:59:39
DateTimeUtil::newDateTime(mkDate(17, 12, 2019), 86400);
As 86400 is maximum time value for given date (24 hours * 60 minutes * 60 seconds)
In Dynamics 365FO, systemDateGet() is usable but obsolete, and you'll get Best Practice warning.
You should rather use
DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone())
No comments:
Post a Comment