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

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Save Seconds on DateTime Field

(0) ShareShare
ReportReport
Posted on by 224

Hi Experts

Is it possible to save seconds to the custom date time field? if its possible how can i add the seconds on the custom field.

Thanks in advance for the help

I have the same question (0)
  • KaeL Profile Picture
    224 on at
    RE: Save Seconds on DateTime Field

    Thank you so much for the information

  • Verified answer
    LeoAlt Profile Picture
    16,331 Moderator on at
    RE: Save Seconds on DateTime Field

    Hi partner,

    Unfortunately D365 dose not support show seconds in datetime field,  The datetime fileds in D365 are encapsulated controls.

    7028.pastedimage1572244960145v1.png

    You could create a web resource like Html to show it or create a input field to show date with seconds.

    For example, I have an input field named "Time" and I want to set a datetime value with seconds to it, you could refer to the following code.

    function setTimeToInput(executionContext){
        var formContext = executionContext.getFormContext();
        var today=new Date();
        var year=today.getFullYear();
        var month=today.getMonth();
        var day=today.getDate();
        var hour=today.getHours();
        var min=today.getMinutes();
        var second=today.getSeconds();
        formContext.getAttribute("Time").setValue(year+"-"+month+"-"+day+"-"+hour+":"+min+":"+second);

    }

    Please share more details about your requirement so that we could find out other better ways to do this.

    Hope it helps.

    Best Regards,

    Leo

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 101 Super User 2025 Season 2

#2
Suresh Kulla Profile Picture

Suresh Kulla 69 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 58

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans