cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

date format not displaying correctly in CDS table

Hi all,

 

Experiencing an issue with date format and how dates are being stored in a CDS table.

Using now() from a canvas app which is performing a patch to a table, the date is being stored in a MM/dd/YYYY format, and not a dd/MM/yyyy format. This is then being returned and displayed back in the canvas app in the incorrect format.

Just wondering how to format this column in the CDS table so that it stores the date in a dd/MM/yyyy?

Can't seem to find any info on this. 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Visitor

Hi all, i have actually found a resolution to this.

As i was returning CDS data into a data table, i ended up enabling under Advanced Settings -> 'Enable improved data table control selection and value property'.

 

From there, i was able to format the date column in my data table to a dd/mm/yyyy format, like below:

 

Text(ThisItem.date_column,"[$-en]dd-mm-yy hh:mm AM/PM")

 

Thanks all for the replies

View solution in original post

4 REPLIES 4
Resolver I
Resolver I

Hi @Jeremy_Ceran89 ,

 

In model driven app, while creating date time field we cannot change the format. It will save values in mm/dd/yyyy format.

 

To change the format we can modify in personal options of user. so that format will be displayed based on short date format (it depends on region). I selected English-India.

Prakash4691_0-1610501527920.png

If you don't want to change in MDA, instead modify in canvas app. It is simple and reliable.

 

Change the datacardvalue format property of date field to same as in MDA. FYR attached screenshot.

Prakash4691_2-1610502061699.png

 

 

Regards,

Prakash

Super User II
Super User II

Hi @Jeremy_Ceran89,

To answer your original question, dates in Dataverse are being stored as UTC with the following format:

  • Date Time: yyyy-mm-dd'T'HH:mm:ss'Z'
    e.g. 2019-12-10T00:31:13Z
  • Date: yyyy-mm-dd
    e.g. 2019-12-10

More on date behaviors: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/behavior-format-date-time-attribu... 

Hope this helps...

Responsive Resident
Responsive Resident

CDS is UTC, now() may not be, you need to tell now() what format i.e. UTC when you update CDS. See the UpdateContext in the solution of the following post https://powerusers.microsoft.com/t5/Building-Power-Apps/Eastern-Time-Zone-Using-Now-Function/td-p/17...

Frequent Visitor

Hi all, i have actually found a resolution to this.

As i was returning CDS data into a data table, i ended up enabling under Advanced Settings -> 'Enable improved data table control selection and value property'.

 

From there, i was able to format the date column in my data table to a dd/mm/yyyy format, like below:

 

Text(ThisItem.date_column,"[$-en]dd-mm-yy hh:mm AM/PM")

 

Thanks all for the replies

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Users online (21,605)