Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Convert Date to Text

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi!

I have a date field that is controlled by the customer. Any date can be added there (for example 2017-05-29). 

Then I need a field in the same entity to look at this field and show the year and month but in text. So the example above should then show "2017-May"

How should I solve this?

regards,
Tomas

*This post is locked for comments

  • Suggested answer
    Ryan Maclean Profile Picture
    Ryan Maclean 3,070 on at
    RE: Convert Date to Text

    Hi Swede-T,

    You could use the Workflow Elements solution by Aiden Kaskela to solve this https://kaskelasolutions.com/

    Ryan

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Convert Date to Text

    Hi,

    You can use javascript to do this.

    var date =new Date(Xrm.Page.getAttribute('date').getValue()),
    locale = "en-us",
    month = date.toLocaleString(locale, { month: "long" });


    Thanks...

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Convert Date to Text

    You will have to write either JavaScript or C# (plugin).

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Convert Date to Text

    Hi!

    Ok so this is not possible to do without using java or functions?

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Convert Date to Text

    stackoverflow.com/.../get-month-name-from-date similarly you can get the year by getYear() method.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,309 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans