web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Verified answer
    Blue Wang Profile Picture
    on at
    RE: How to get DateTimeutil Year start date and end Date in D365Fo.

    Hi Riyas,

    Use this code:

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

    6011.PNG

  • Riyas ahamed F Profile Picture
    1,215 on at
    RE: How to get DateTimeutil Year start date and end Date in D365Fo.

    Many thanks blue wang,

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,004

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 548 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans