
Announcements
Hi All,
I've managed to get my clock working but now I'm trying to calculate the time difference between a saved date:time in a table and now.
I have a Table in a Data source titled "EWDData2" with a column titled "Time".
i also have the current time updating in my textbox titled "textbox1".
I'd like to ideally get the difference to show in the text format hh:mm:ss
Here's what I have so far but its not working, hoping you can help.
DateDiff(Last(EWDData2).Time,textbox1,Seconds)
Thanks in advance for any help you can provide
Dave
PowerApps is a mess, as it allows you occasionally to refer to a label (a.k.a. text box) just by the name of the object. This will sometimes work, sometimes not. In your case it seems not to.
The only sure way to refer to the contents of textbox1 is textbox1.Text, which is by definition a text type value and not datetime. Hence the safest way to refer to the time value displayed by textbox1 is to convert from text to datetime.
Hence:
DateTimeValue(textbox1.Text)
(You may need the second parameter of language if you have locale issues)
Hence the full formula should be:
DateDiff(Last(EWDData2).Time, DateTimeValue(textbox1.Text), Seconds)
Please let me know if this works.