Skip to main content
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:
  • Ruben Aghajanyan Profile Picture
    on at
    RE: How can we show only time in date and time field or provide functionality to enter only time.

    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

  • Suggested answer
    Pierre Andre Joubert Profile Picture
    175 on at
    RE: How can we show only time in date and time field or provide functionality to enter only time.

    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

  • Christian K Profile Picture
    138 on at
    RE: How can we show only time in date and time field or provide functionality to enter only time.

    Hi,

    is there a solution for this without JS by now?

    Thx

  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: How can we show only time in date and time field or provide functionality to enter only time.

    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

  • Suggested answer
    Adrian Begovich Profile Picture
    1,025 Super User 2025 Season 1 on at
    RE: How can we show only time in date and time field or provide functionality to enter only time.

    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);
    }

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

News and Announcements

Now Available: 2025 Release Wave 2

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

Featured topics

Product updates

Dynamics 365 release plans