Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

How to use only Date from Datetime field?

(0) ShareShare
ReportReport
Posted on by 15

Hi Everyone,

I am trying to use only Date from the DateTime field ("Created on" field). I am using the below C# code:

"string date = targetEntity.FormattedValues["createdon"].ToString();"

But it is giving the time also along with the date, how can I remove the time or how can I fetch only the date?

  • Community Member Profile Picture
    on at
    RE: How to use only Date from Datetime field?

    Hi Partner,

    Can you click Yes under "Did this answer your question?" to close this thread if my answer is helpful.

     pastedimage1639729611582v1.png

    Thanks in advance!:)

  • Tarun Ramawat Profile Picture
    15 on at
    RE: How to use only Date from Datetime field?

    Thank you, Leah Ju.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: How to use only Date from Datetime field?

    Hi Tarun,

    You can use DateTime.ParseExact(string s, string format, IFormatProvider? provider) to convert into a date-only format.

    (+) C# code to convert string to date without time - Microsoft Dynamics CRM Forum Community Forum

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#2
Ramesh Kumar Profile Picture

Ramesh Kumar 42

#3
David Shaw_UK Profile Picture

David Shaw_UK 27

Featured topics

Product updates

Dynamics 365 release plans