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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Implicit conversion from date to utcDateTime is not supported

(0) ShareShare
ReportReport
Posted on by

Hi all,

In regards of best practice, I got a warning when doing this:

TransDate   todays = DateTimeUtil::date(DateTimeUtil::getToday(Datetimeutil::getUserPreferredTimeZone()));

the warning is at the topic subject.

So what is the best approach of getting todays date to comply with BP ?

Thanks 

I have the same question (0)
  • Verified answer
    udaY-ch Profile Picture
    5,182 on at

    hi,

    Use this way

    1. TransDate   todays = DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone());

    2. TransDate   todays = DateTimeUtil::date(DateTimeUtil::utcNow());

    In Date function, we need to pass utcDateTime,

    0044.Date.png

    and getToday function returns date

    date2.png

    that's why BP warning says "Implicit conversion from date to utcDateTime is not supported"

    Uday

  • Verified answer
    Blue Wang Profile Picture
    Microsoft Employee on at

    HI WWwong,

    DateTimeUtil::date() requires DateTime, but DateTimeUtil::getToday() returns Date.

    50611.PNG27704.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

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288 Super User 2026 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 270 Most Valuable Professional

#3
Anton Venter Profile Picture

Anton Venter 217 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans