Friday, February 17, 2023

Get current date EOD in D365FO X++

//It can also changed to COMPANY TIMEZONES 

public static utcDateTime endOfDay(utcDateTime _dateTime)

    {

        Timezone userTimeZone = DateTimeUtil::getUserPreferredTimeZone();

        utcDateTime dateInTimeZone = DateTimeUtil::applyTimeZoneOffset(_dateTime, userTimeZone);


        return DateTimeUtil::newDateTime(DateTimeUtil::date(dateInTimeZone), timeMax(), userTimeZone);

    }


No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...