Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Answered

Save Seconds on DateTime Field

(0) ShareShare
ReportReport
Posted on by 220

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

  • KaeL Profile Picture
    KaeL 220 on at
    RE: Save Seconds on DateTime Field

    Thank you so much for the information

  • Verified answer
    LeoAlt Profile Picture
    LeoAlt 16,329 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans