preloader-matrix

Alfasith

Convert UTCDateTime to date & date to UTCDateTime in AX

Hi,

    print DateTimeUtil::newDateTime(today(), 0, DateTimeUtil::getCompanyTimeZone());
    // Here today() is the date format not utcdatetime format…

    print DateTimeUtil::date(UTCFieldValue);
    // Here UTCFieldValue is theUTC date time field…

    //Get date diff from 1 UTC date time and another date type in AX
    return DateTimeutil::getDifference(
                        DateTimeUtil::newDateTime(resRentAgreement.StartDate, 0,       DateTimeUtil::getCompanyTimeZone()),
                        resGracePeriodHistory.createdDateTime))
// here resRentAgreement is the date field and resGracePeriodHistory is UTCDateTime field.

Regards,

Leave a Reply

Your email address will not be published.