cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BSchaap
New Member

DataVerse date value incorrect (time-zone issue?)

Hi all,

I have this weird problem, which is really annoying me, it is about date’s:

To test it I created a table in DataVerse (CDS) called ‘Bull**bleep**’, like I said I am annoyed 😊.

BSchaap_1-1618990476827.png

 

Figure 1

It has two columns one with CDS datatype DateOnly and one with CDS datatype DateTime.

As you can see in figure 1, I entered a date in European style 1-4-2021 which means April first in both fields (not a joke!). This was done using an auto generated power app see figure 2.

BSchaap_2-1618990476831.png

 

Figure 2

Here is the weird part:

I made a small flow which reads these two fields, see figure 3:

BSchaap_3-1618990476834.png

 

Figure 3

This is the output of this flow:

BSchaap_4-1618990476837.png

 

Figure 4

As you can see it displays this date as March 31 instead of April 1!

My suspicion is that this is somehow connected to a time zone. I am located in Amsterdam which is currently UTC-2. As the date is entered as 4/1/2021 12:00 AM it all depends on what this means and how it is interpreted.

In Europe we use 24 hour notation, so there is no confusion but what does 12:00 AM mean? Given the above behavior I think it means 00:00 in 24 hour notation. When 2 hours are subtracted then then date will become 1 day earlier, hence March 31.

My question, how can I get Flow to read the correct date?

FYI: these date’s are used in Dynamics 365 and strangely enough in D365 the dates remain correct, only when retrieving them and using them in Flow (in my case used in an email for notification) I get this behavior.

Best regards,

Bart Schaap

1 ACCEPTED SOLUTION

Accepted Solutions

Found the solution myself 😀

Use convertTimeZone function using UTC as source timezone and in my case 

W. Europe Standard Time as destination timezone. Now I get the correct date in flow.

View solution in original post

3 REPLIES 3
Rilsina
Resolver II
Resolver II

Hi,

 

Hopefully this blog will help-https://www.cloudfronts.com/solved-date-field-shows-wrong-date-in-power-automate/

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

The blog is incorrect in my opinion. I tried both field types (datetime and dateonly). They behave the same as you can see in my post.
As for the workaround: this is not what I am looking for. Simply adding a day is not a reliable solution to this problem.

Best regards

Bart Schaap

Found the solution myself 😀

Use convertTimeZone function using UTC as source timezone and in my case 

W. Europe Standard Time as destination timezone. Now I get the correct date in flow.

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (19,950)