Announcements
Greetings. For some reason, after inserting an item into an SQL table, the time displayed in PowerApps adopts a weird format. For example, if I try to insert a row with a time value equal to 08:16 and try to display it back, it shows as PT8H16M.
Hello @jmarc ,
As far as I remember, this format is used as some sort of standard. I've seen it in Power Automate for example.
Can you try formatting back to normal with "Text()"?
Text(time, "hh:mm")
Hello. I've tried formatting it the way you suggested, but it still shows as PT8H16M.
How is it stored in your table? Does the SQL table shows "PT8H16M" or "08:16"?
How do you add the time in your SQL table? Are you using "Patch()" and "Now()" or something else?
It shows like this (the image I added). It's a SQL column with time datatype.
I'm using a text input as a control. Its default value is set to:
Text(Now();"hh:mm")
To add it, I'm using a patch function with the form:
Patch(TableName; Defaults(TableName); { ... txtTime.Text; ... });;
I found this article, and that pretty much describes your situation.
https://powerapps.microsoft.com/hu-hu/blog/working-with-datetime-values-in-sql/
Basically, Power Apps uses a datetime format for its data. Because your SQL table uses a time-only column, Power Apps fails to correctly translates it.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 491
WarrenBelz 407 Most Valuable Professional
11manish 331