web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Subtract hours from modifiedDateTime

(0) ShareShare
ReportReport
Posted on by 1,370

Hi,

I want to subtract 24 hours from the modifieDateTime value of any record. The requirement is to get all records from the modifiedDateTime provided to last 24 hours modifiedDateTime records. While I tried to subtract 24 from the value, it throws incompatibility error.

Any help would be much appreciated.

Regards,

Rishi

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Hi Rishi,

    you may use DatetimeUtil, which provides lot of functions, using standard API

    utcDateTime varDateTime;
        
        varDateTime = DateTimeUtil::utcNow();
        
        info(strFmt('Current Date Time: %1',varDateTime));
        
        varDateTime = DateTimeUtil::addHours(varDateTime,-24);
        
        info(strFmt('Before 24 Hours %1',varDateTime));



  • Rishi1403 Profile Picture
    1,370 on at

    Thanks Sohaib.... it works for me... :)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans