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 :
Customer Service forum

How can we show only time in date and time field or provide functionality to enter only time.

(0) ShareShare
ReportReport
Posted on by 249

How can we show only time in date and time field or provide functionality to enter only time.

Categories:
I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi raki,

    If you create a standard date and time field you can use JavaScript to extract the time from the field and set another field with the time value. Here is an example JavaScript function for this.

    function getTime()
    {
         var date = Xrm.Page.getAttribute("date").getValue();
         var hours = date.getHours();
         var minutes = date.getMinutes();
         var time = "" + hours + ":" + minutes;
         Xrm.Page.getAttribute("time").setValue(time);
    }
  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    1.Unfortunately, there is no OOB function to do this.

    When we creating a datetime field, we could only choose the format to "date and time".

    community233.png

    community233.png

    docs.microsoft.com/.../behavior-format-date-time-field

    2.You could use js code to control the format of the datetime field.

    Here is a sample for more steps.

    https://community.dynamics.com/crm/b/mscrmcustomization/archive/2015/01/20/show-only-time-for-date-time-attribute

    Hope it helps.

    Best Regards,

    Leo

  • Christian K Profile Picture
    144 on at

    Hi,

    is there a solution for this without JS by now?

    Thx

  • Suggested answer
    Pierre Andre Joubert Profile Picture
    175 on at

    Hi, there is a built-in option to achieve the display of time only.

    It is by using the "Time without Date" component control on the datetime field on the form

  • Ruben Aghajanyan Profile Picture
    on at

    Christian K   Pierre Andre Joubert

    Yes, we have.

    You can download a free control from the link below and import it into your Dynamics 365 instance.

    marketplace.bevercrm.com/.../TimePicker

    It has YouTube instructions on how to install it.

    Regards,

    Ruben

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans