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

Datediff()

Hello community,

I'm working on an app where I'm working to calculate the break time duration of an employee. When I test my app on power apps it gives me the right value, but when I test my apps on teams it gives me the wrong value. 

taimoorahmed897_0-1665170121616.png

the formula expression which I am using to patch my break duration  is:

Patch(SPlist,Defaults(SPlist){

BreakDuration : DateDiff(
DateTimeValue(
Bintime.Text,
"fr-FR"
),
Now(),
Minutes
)

})

Bintime is my label where im displaying my break start time and im using this in my formula too.

2 REPLIES 2

 

@taimoorahmed897 

 

Check here if it helps

 

Date/Time is wrong 

If you don't have a server side solution, and need a simpler solution, check if you can do this below instead:

 

 

Set(varCurrentTime, Now());
DateDiff(
DateTimeValue(
Bintime.Text,
"fr-FR"
),
varCurrentTime,
Minutes
)

 

 

 It's possible Power Apps is caching the Now() and calculating it only once - and maybe more so in Dataverse for Teams - and perhaps an explicit Set to a variable forces it to update, for some reason.

 

Does the above help?

Hello @poweractivate ,

thanks for your reply but still i am facing the same issue.

taimoorahmed897_0-1665172265198.png

some users have the right value in their column, and also when im getting right value through power apps but not from teams.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,742)