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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

getting current day from given date

(0) ShareShare
ReportReport
Posted on by

how can i calculate current day from given date

*This post is locked for comments

I have the same question (0)
  • @NoMe Profile Picture
    217 on at

    Do u mean days between current date or day of the given date?

    For days between current date

    substract current date minus given date you will get days

    other wise

    dayOfMth(givendate)

  • Community Member Profile Picture
    on at

    like 23/12/2017 i need to get 23 from 23/12/2017

  • @NoMe Profile Picture
    217 on at

    use info(strFmt('%1',dayOfMth(today())));

  • Community Member Profile Picture
    on at

    n for total number of days

  • Martin Dráb Profile Picture
    239,634 Most Valuable Professional on at

    Didn't @NoMe answer your question? I think that dayOfMth() gives you what you asked for.

    By the way, I have no idea what you mean by "n for total number of days". It's not even a sentence. Please invest some time to formulate your questions, if you want our help.

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Please use below code to get number of days from your current date/given date

    static void AXC_NoOfDays(Args _args)
    {
        date d = mkDate(12,12,2017); // or today(); to given current date
        int FromDays, ToDays;   
        
        FromDays = date2num(DateStartMth(d)); 
        
        todays = date2num(d);
        
        info(strFmt("No of days: %1", (ToDays+1) - FromDays));
    }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 24

#2
Michel ROY Profile Picture

Michel ROY 14

#3
Jagadabi Profile Picture

Jagadabi 6

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans