Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Saturday, October 11, 2014

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,

No comments:

Post a Comment

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...