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

Date is different in logic apps

Hi,

I have a canvas app that is used to submit information about people, for example date of birth. The data is stored in Dataverse. After the data is submitted an Azure Logic app is triggert. This uses the data from dataverse is an email and sends it. The problem I experience is that the date in the logic app is different from the date that is stored is Dataverse. For example: in the canvas app 18-08-2021 is submitted. This date is also stored in the table. Then when I check the logic app trigger (Dataverse: When a new records is created) the date changed to 17-08-2021. It seems to change between Dataverse and Logic apps. When I check the output of the trigger the date is allready changed. 

 

My first gues would be something with the time zone. But I am not sure...

 

Does anybody experience this issue and know how it can be resolved?

1 ACCEPTED SOLUTION

Accepted Solutions
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @jvdl ,

 

While patching the record you can use the below formula for all the date controls. It will store the value in UTC format. 

DateAdd(Now(),TimeZoneOffset(), Minutes); 

 

And while displaying any date time field in your Powerapps please use the below format in the DateDefault property. This you show the date stored in the UTC format in user local timezone. 

 

DateAdd(Now(),-TimeZoneOffset(), Minutes); 

 

This way for all the Logic aoo operations can be performed in UTC format and the date time field will have uniform value in UTC even if multiple users of different time zone will submit the data. 

 

 Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

6 REPLIES 6
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @jvdl , 

 

It is because of timezone difference. 

Please try below formula 

Patch

DateAdd(Now(), -TimeZoneOffset(), Minutes); 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

jvdl
Frequent Visitor

Hi @PG_WorXz10 ,

Thank you for your response. Could you clarify where I need to use the formula? When I check the table where the data is stored the values do match the value that has been submitted. To I need to change the formula in the canvas app or in the Logic app? If I need to change it in the Canvas App, on what property should the formula be applied?

 

Thanks again.

PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @jvdl ,

 

While patching the record you can use the below formula for all the date controls. It will store the value in UTC format. 

DateAdd(Now(),TimeZoneOffset(), Minutes); 

 

And while displaying any date time field in your Powerapps please use the below format in the DateDefault property. This you show the date stored in the UTC format in user local timezone. 

 

DateAdd(Now(),-TimeZoneOffset(), Minutes); 

 

This way for all the Logic aoo operations can be performed in UTC format and the date time field will have uniform value in UTC even if multiple users of different time zone will submit the data. 

 

 Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

jvdl
Frequent Visitor

Hello @PG_WorXz10 ,

Thank you again for you response. Unfortunately it didn't solve my problem. The data in the logic app, table and Canvas app now show one day earlier than what I submitted. For example: In the app I typed 07-07-2007 in de data field. After submitting the form I see 06-07-2007 in the Canvas app, Dataverse table and in the Logic app.

Any other Ideas?

PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @jvdl ,

 

It is because your datasource is in different timezone and not in your local timezone. 

You can test the below formula to check the date field are getting submitted correctly or not. 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

jvdl
Frequent Visitor

Hi @PG_WorXz10 ,

Thanks again for your help. Because we only need to use the date and not the time I have created a formula that changes the time:

DateAdd([Datafield];-TimeZoneOffset();Minutes)

This give the desired result. Thanks again for you help. 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,389)