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

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...