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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to get DateTimeutil Year start date and end Date in D365Fo.

(0) ShareShare
ReportReport
Posted on by 1,215

Hi, guys

i want to create start date endDate in the DateTimeutil class so that i wrote a small code but, in the parameter( str _Locale , )also it is system class i can't open those class what should i do 

also i don't want dateStartMth and Endmth function.

Example:

TransDate startDate, EndDate;

startDate = DateTimeUtil::getStartOfYearDate(str _Locale, date _date)

EndDate = DateTimeUtil::getEndOfYearDate(str _Locale, date _date);

regards,

Riyas ahamed F

I have the same question (0)
  • Riyas ahamed F Profile Picture
    1,215 on at

    Many thanks blue wang,

  • Verified answer
    Blue Wang Profile Picture
    on at

    Hi Riyas,

    Use this code:

    date startDate, endDate;
    xSession xSession = new xSession();
    startDate = DateTimeUtil::getStartOfYearDate(xSession.preferredLocale(), DateTimeUtil::getToday(DateTimeUtil::getUserPreferredTimeZone()));

    6011.PNG

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

News and Announcements

Season of Giving Solutions is Here!

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 867 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 514 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 348 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans