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)

total number of days in a month

(0) ShareShare
ReportReport
Posted on by

how can i calculate the total number of days in a month

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Shah Keyur Profile Picture
    365 on at

    You can use DateStartMth and endMth to get start and end date of a month. Substract them to get number of days.

    There are few other methods available in Global class and in System functions please have a look.

  • Community Member Profile Picture
    on at

    could you please tell me how can i get the current date of the selected month

  • Community Member Profile Picture
    on at

    use today() method

  • Suggested answer
    Pravasti AK Profile Picture
    2,985 on at

    Hi

    Please refer the below link

    http://ax2012madhav.blogspot.in/2012/10/number-of-days-in-month.html

     

    Thanks,

    Kavitha

  • Community Member Profile Picture
    on at

    today() will give today's date i need to select the current date of selected month that can be 12 of july or 7 of may so, i want to select 12  or it can b 7

  • Community Member Profile Picture
    on at

    i have already go through on it but no thing effective found

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

    Hi,

    Please use following code/job to get number of days for a given date

    static void AXC_NoOfDays(Args _args)
    {
        date d = mkDate(12,11,2017);
        int FromDays, ToDays;   
        
        FromDays = date2num(DateStartMth(d)); 
        
        todays = date2num(endmth(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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans