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

Announcements

No record found.

News and Announcements icon
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?

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    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

  • Tarun Ramawat Profile Picture
    15 on at

    Thank you, Leah Ju.

  • Community Member Profile Picture
    on at

    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!:)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
11manish Profile Picture

11manish 36

#2
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 32

#3
ManoVerse Profile Picture

ManoVerse 30 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans