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

Notifications

Announcements

No record found.

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,133 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
    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

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
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans