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 :
Microsoft Dynamics CRM (Archived)

How to show dates in a long format?

(0) ShareShare
ReportReport
Posted on by 4,130

Hi

I'm using CRM 2011. Currently dates showing in short format but I would like to show it in long format

Any idea please?

*This post is locked for comments

I have the same question (0)
  • Royal King Profile Picture
    27,686 on at

    which format you want, can you post example date format?

  • Suggested answer
    Mithilesh Kumar Profile Picture
    10,047 on at

    Hi Alaa,

    You can go to the field properties and change the format there.

    Hope that helps

    Thanks

  • Community Member Profile Picture
    on at
  • Alaa Ramadan Profile Picture
    4,130 on at

    In my personal settings shows the following under  English (united States):

    Short format:  M/d/yyyy

    Long format: dddd, MMM, dd, yyyy

    I want date to be showing in the long format where it's currently showing in short one

  • Mithilesh Kumar Profile Picture
    10,047 on at

    The date format is a personal setting for each CRM user. Each user can choose the date format they prefer based on the language list.

    For CRM 2011 the option is under File -> Options -> Formats.

    Below you can find the tool to change the setting programmatically for users

    crm2011usersettings.codeplex.com

    Hope that helps

    Thanks

  • Aileen Gusni Profile Picture
    44,524 on at

    Hi Alaa,

    I think you have known how to modify the format, either through the System Setting or Personal Options, right?

    Your problem is how to show it?

    According to this link:

    blogs.msdn.com/.../long-date-formatting-and-in-swedish-please-o.aspx

    In the CRM View and Form, we can only see the short date format, so in CRM will only see the short date format, you need to code it if you want.

    Thanks.

  • Alaa Ramadan Profile Picture
    4,130 on at

    You got it - thanks Eileen

    Could you refer me to any code sample that would achieve that.

    I need to show the date format as something like : 'Wed. April 1, 2015'

    Bess tregards

  • Suggested answer
    Mithilesh Kumar Profile Picture
    10,047 on at

    Hi Alaa,

    Here is the code to show Long Date for a given date.

    function showLongDate(){
     objDate = Xrm.Page.getAttribute("createdon"); // put your date field here
     if(objDate != null){
      varDate = objDate.getValue();
      varYear = varDate.getFullYear();
      varMonth = varDate.getMonth();
      arrMonths = new Array('January', 'February', 'March', 'April', 'May', 'June', 'Jully', 'August', 'September', 'October', 'November', 'December');
      currDate = varDate.getDate();
      currDay = varDate.getDay();
      arrDays = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
           
      formattedResult = arrDays[currDay]+', '+arrMonths[varMonth]+' '+currDate+', '+varYear;      
      alert(formattedResult);

      Xrm.Page.getAttribute("description").setValue(formattedResult); // change your field value here
     }
    }


    Change the field values for the highlighted line

    Hope that helps

    Thanks

  • Suggested answer
    Aileen Gusni Profile Picture
    44,524 on at

    Hi Alaa,

    Before the code, where do you want to place?

    I don't think you want to apply the code to all of the date field in CRM form/view right?

    That's kind of over-effort I think.

    And you also need to create one field, cannot be the datetime field to store the value.

    Need you to reconsider the effort versus the outcome before you are thinking about the code.

    Anyway, this is the good reference for the format you want.

    msdn.microsoft.com/.../ff743760(v=vs.94).aspx

    Thanks.

  • HenryBinan Profile Picture
    169 on at

    Hi Aileen,

    I am also looking for this solution of displaying the long date in an Order form.

    And i have just started using Dynamics 365 for 2 months now.

    Is there any way we can achieve this without writing a code?

    Thanks

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans