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 :
Customer experience | Sales, Customer Insights,...
Unanswered

Taking the last day of the month in Date and Time Field

(0) ShareShare
ReportReport
Posted on by 5

We have a Calculated Field with Data Type:Date and Time (let's call it Y) . The value is based on another Date and Time field (X) and it needs to be the last day of the next month. For example

X = 12.4.2021, i need Y=31.5.2021

Version 1612 (8.2.1.176) (DB 8.2.1.176) on-premises

Can we do that?

  • Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi,

    If calculated field creation is not mandatory then 

    I would suggest to use some other business logic like Plugin, Script etc.

    These approach will be easier one.

    Thanks,

    Pradeep.

  • Esteban Coto Alfaro Profile Picture
    Microsoft Employee on at

    Hello, I recommend you to do something like this in JavaScript, this does not require any library:

    var date = new Date();

    var lastday = new Date(date.getFullYear(), date.getMonth() + 1, 0); // the + 1 in the month refers to the actual month, if you want the last day of the next month you must put + 2.

    Thanks!

    Community Support Team - Esteban

    If this Post helps, then please consider Accept as solution to help the other members find it more quickly.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 93 Super User 2026 Season 2

#2
Travis South Profile Picture

Travis South 71

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 54 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans