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 : 8eZK/UmCg9pFH3YjIZygIG
Power Apps - Microsoft Dataverse
Unanswered

Separating Date and Time columns

Like (0) ShareShare
ReportReport
Posted on 14 Jan 2022 00:03:22 by 501

Hi all 

 

I have a single column that is date and time. I need the date and time separated so that when I export data to excel, they're in their own columns and it doesnt require me to re-create the date/time column as separate date and time columns in excel. 

 

Is their a way I can do this somehow? This is also crucial because the data gets exported to CSV and then saved as .txt and cant have date/time joined. 

 

Thanks for your help all. 

  • Ram Prakash Profile Picture
    5,309 Super User 2025 Season 2 on 17 Jan 2022 at 05:53:31
    Re: Separating Date and Time columns

    Hello @Usernametwice23,

     

    You need to write this JS in ONCHANGE of the Date Field. Please find my Youtube for Step by step Guidence for how to write JS

     

    https://www.youtube.com/watch?v=x8kYNCkikgs&t=14s

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

  • Usernametwice Profile Picture
    501 on 17 Jan 2022 at 02:11:24
    Re: Separating Date and Time columns

    @rampprakash Thanks for your help. Do you mind letting me know where to write these scripts? I did not know it was possible to do with Dataverse which is very interesting. Thanks again!

  • Nhelgren Profile Picture
    on 14 Jan 2022 at 22:29:23
    Re: Separating Date and Time columns

    Dataverse does not have a Data Type for time only. @rampprakash has made a good suggestion below

  • Ram Prakash Profile Picture
    5,309 Super User 2025 Season 2 on 14 Jan 2022 at 05:21:10
    Re: Separating Date and Time columns

    Hello @Usernametwice23,

     

    As per OOB Behavior there is no Such behavior available in Dataverse Environment. 

     

    Suggestion:

     

    Create a New Field in Dataverse Environment GET the TIME from DateTime and Save it in that text, then while exporting export that row too..

     

    You need to write below SCRIPT

     

    function getTime(executionContext)
    {
    var formContext = executionContext.getFormContext();
    var Date = formContext.getAttribute("DATETIMEFIELDLOGICALNAME").getValue();
    var Hours = Date.getHours();
    var Minutes = Date.getMinutes();
    formContext.getAttribute("TEXTFIELDLOGICALNAME").setValue(Hours +":"+Minutes);
    }

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Featured topics

Loading complete