cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

Flow owner timezone incorrectly affects Power Automate date input into a CDS "Date Only" field

Microsoft's document explicitly states that CDS "Date Only" fields should not be impacted by user time zone. https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/behavior-forma...

When using Power Automate to update "Date Only" date fields, when the owner of the Flow has a timezone of UTC-06:00 'Central Standard Time," Power Automate is subtracting 6 hours from the input date, causing the date to appear as 1 day less.

UPDATED HYPOTHESIS: When dates are input into Date Only fields by a Flow (rather than a canvas app or model driven app), they break the "Date Only" characteristics of those fields and cause them to behave like "User Local" date/time fields, so Canvas and Model Driven apps start adding and subtracting hours. 

 

To reproduce the bug, use a Flow owned by a user in any non-UTC timezone to copy a date from one Date Only field to another Date Only field (or the same Date Only field in another record), and then look at the results in a Model Driven App or a Canvas App.

Example 1: In the canvas app below you can see the results of a Flow copying dates from a "19-20" record to a "20-21" record. All date fields are "Date Only". The Flow appears to be subtracting 5 or 6 hours from the original date. The dates that were entered by the Flow are all behaving like "User Local" dates, subtracting 6 hours because my timezone is UTC-06:00
Each pair of records in the screenshot below shows the same behavior: the dates created by Power Automate are all 5 or 6 hours behind, in spite of Power Automate reporting those same field values as "T00:00:00Z," see below.

timesaredifferent.png

Example 2: The same data from a Model Driven App

datesdontmatch.png

You cannot see the problem from Power Automate alone--its logs incorrectly report the date values as being correct.

Example 1: Output from a Flow copying the date from one record to another. Both dates appear correct, but the date on the right actually appears as "January 7, 2020 6:00 PM" in a Canvas App.

datesarethesame.png

Example 2: Raw output of a Flow "List Records" step, showing dates from two records. They appear to be the same, but they are actually not.

datesthesame2.png

Example 3: The output report of a Flow showing a date with a T00:00:00Z suffix; however, both the Canvas and Model Driven apps show a time that is 6 hours prior to this.

result.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver II
Resolver II

Re: Flow owner timezone incorrectly affects Power Automate date input into a CDS "Date Only" field

Found a solution!

The problem was that my Date Fields had the Data Type of "Date Only" but their Behavior was still set to "User Local."

 

The "Behavior" property on Date fields is hidden behind the "Advanced" toggle when creating new fields.

 

datatype vs behavior.PNG

Changing the "Behavior" to "Date Only" solved the problem.

View solution in original post

8 REPLIES 8
Highlighted
Community Support
Community Support

Re: Flow owner timezone incorrectly affects Power Automate date input into a CDS "Date Only" field

Hi @jzcase,

 

I have tested the situation you mentioned, but not find the same issue:

 

I create a column named "Test Date Only", it is Date Only formate, I add a date when creating a Record, after create it I create a copy one in the following step. And I create "Test Date Only" of the other record by using the dynamic content of the previous step.

Annotation 2020-01-14 113552.png

Annotation 2020-01-14 113831.png

 

This is the table I created in Power Apps, it is a canvas app, the Date is correct.

Annotation 2020-01-14 113309.png

 

So, I assume that when you copy the date, you did not format the date, the Date data saved, and it will appear when you display them in apps.  Please using the formateDate() function when you copy date. If you did, please share your Flow configuration, thanks.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Highlighted
Resolver II
Resolver II

Re: Flow owner timezone incorrectly affects Power Automate date input into a CDS "Date Only" field

Thank you for working through this with me. I have some questions and some observations. I still think there is a serious bug.

1. Can you show me the Output of your Flow that used formatDateTime('2019-12-16T12:00:00Z'...) to create your original date?

I suspect Power Automate actually chopped off your T12:00:00Z and replace it with T00:00:00Z, because that is the expected behavior for Date Only fields.

2. What is your user timezone?

If I were a betting man, I would say that it is UTC+08:00

 

Now some observations

I think that your reply actually does demonstrate the bug. Look at the difference between what you entered and what resulted in PowerApps.

aha.png

 

Why are these times different? They shouldn't be. In fact, the Canvas App shouldn't be showing "8am" at all--it should always show 12:00:00 AM because these are Date Only fields. See: Behavior and format of the Date and Time field 

Here is what I think is happening in your demo, and you can confirm or disconfirm:

  1. You are using formatDateTime() to enter a date into your starting record, with a time suffix T12:00:00Z
  2. PowerAutomate ignores your T12:00:00Z and changes it to T00:00:00Z (see question #1 above). This is expected behavior because Date Only fields always force a time value of T00:00:00Z.
  3. Because your user account is UTC+08:00 (my guess), Canvas Apps (and probably Model Driven Apps) adds 8 hours to all of your test values, which is why they all show 8:00:00 AM.
  4. If your timezone was UTC-06:00 (like mine), the your canvas app would subtract 6 hours from your date values, resulting in the wrong dates.

Note that this behavior only occurs when Power Automate is used to enter the dates. In your reproduction, you used Automate to create and copy all of the dates. In my example, the original dates were entered by a user in a Model Driven App. That's the difference.

When dates are entered via Model Driven Apps or Canvas Apps, there is no bug--they result in 12AM time values. Here's a quick example of dates that were entered by my users from a Canvas App:

enteredfromcanvasapp.png

Conclusion (also updated the OP):

When dates are input into Date Only fields by a Flow (rather than a canvas app or model driven app), they break the "Date Only" characteristics of those fields and cause them to behave like "User Local" date/time fields, so Canvas and Model Driven apps start adding and subtracting hours. 

Highlighted
Resolver II
Resolver II

Re: Flow owner timezone incorrectly affects Power Automate date input into a CDS "Date Only" field

Would it be rude of me to bump this for a reply? Should I create a support ticket?

Highlighted
Community Support
Community Support

Re: Flow owner timezone incorrectly affects Power Automate date input into a CDS "Date Only" field

Hi @jzcase,

 

Sorry for the delay. Yes, I have confirmed the copy date the only field would not copy the time, and it will adapt according to the time zone. It would make a little confusion though it is by design.

I Tested the Date and Time field, and it did not find the same issue, if possible, you can consider using this type of field instead of date only.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Resolver II
Resolver II

Re: Flow owner timezone incorrectly affects Power Automate date input into a CDS "Date Only" field

What? That's ridiculous.

Date Only fields should never, ever adapt themselves to user timezone. That is how they work.

Power Automate causes them to do this. This is wrong. That is a bug.

You might as well try to convince me that there is nothing wrong with a toaster if it can toast whole grain and rye bread but not sourdough. EDIT: Let's say the toaster does toast sourdough, but in the process turns it into a fish! To make the metaphor both accurate and silly.

 

I have a ticket open for this issue and will continue to escalate until someone starts talking sense.

 

EDIT: I'm going to test replacing the CDS step that inputs the dates with a Dynamics step instead.

EDIT2: Regrettably that was no help. I tried using the Dynamics connector both to retrieve the data and to input it into the new record, and I get the same behavior. So it is not a connector-specific issue.

 

If this doesn't get solved in time for annual student rollover, I will need to resort to using a Classic Workflow to get the job done.

Highlighted
Resolver II
Resolver II

Re: Flow owner timezone incorrectly affects Power Automate date input into a CDS "Date Only" field

Found a solution!

The problem was that my Date Fields had the Data Type of "Date Only" but their Behavior was still set to "User Local."

 

The "Behavior" property on Date fields is hidden behind the "Advanced" toggle when creating new fields.

 

datatype vs behavior.PNG

Changing the "Behavior" to "Date Only" solved the problem.

View solution in original post

Highlighted
Regular Visitor

Re: Flow owner timezone incorrectly affects Power Automate date input into a CDS "Date Only" field

This is especially an issue when attempting to create Time Entry records in Dynamics 365 PSA with Power Automate.

Highlighted
Regular Visitor

Re: Flow owner timezone incorrectly affects Power Automate date input into a CDS "Date Only" field

I would suggest to convert the time zone for the concerned date fields/data in Flow instead of changing the field behavior which should be user-local for user convenience.

 

I used the format yyyy-MMM-dd in time-zone conversion (UTC to +5:30) in flow and used the converted date-time value to assign the same to the target field.

 

Ref. this for more about time-zone conversion - https://flow.microsoft.com/en-us/blog/working-with-dates-and-times/

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Users online (9,920)